freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/3] incubator-freemarker git commit: Removed some deprecated methods...
Date Mon, 20 Feb 2017 21:52:36 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 b3365cbc7 -> ddc907ddf


Removed some deprecated methods...


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/d4dddeb7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/d4dddeb7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/d4dddeb7

Branch: refs/heads/3
Commit: d4dddeb74d6d2724691bd3954db28deb106591c2
Parents: b3365cb
Author: ddekany <ddekany@apache.org>
Authored: Mon Feb 20 22:11:10 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Mon Feb 20 22:13:07 2017 +0100

----------------------------------------------------------------------
 .../apache/freemarker/core/Configuration.java   | 66 +++-----------------
 .../freemarker/core/ast/Configurable.java       |  6 +-
 .../apache/freemarker/core/util/DeepUnwrap.java |  9 ---
 .../freemarker/core/util/_StringUtil.java       | 13 ----
 .../freemarker/servlet/FreemarkerServlet.java   |  2 +-
 .../freemarker/core/ConfigurationTest.java      |  2 +-
 .../test/templatesuite/TemplateTestCase.java    |  2 +-
 .../test/templatesuite/TemplateTestSuite.java   |  4 +-
 8 files changed, 12 insertions(+), 92 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/main/java/org/apache/freemarker/core/Configuration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Configuration.java b/src/main/java/org/apache/freemarker/core/Configuration.java
index 9538532..3c64c1f 100644
--- a/src/main/java/org/apache/freemarker/core/Configuration.java
+++ b/src/main/java/org/apache/freemarker/core/Configuration.java
@@ -216,25 +216,6 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
     /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints.
*/
     public static final String TEMPLATE_UPDATE_DELAY_KEY = TEMPLATE_UPDATE_DELAY_KEY_SNAKE_CASE;
     
-    /**
-     * Legacy, snake case ({@code like_this}) variation of the setting name. @since 2.3.23
-     * @deprecated Use {@link Configurable#AUTO_IMPORT_KEY_SNAKE_CASE} instead.
-     */
-    @Deprecated
-    public static final String AUTO_IMPORT_KEY_SNAKE_CASE = "auto_import";
-    /**
-     * Modern, camel case ({@code likeThis}) variation of the setting name. @since 2.3.23
-     * @deprecated Use {@link Configurable#AUTO_IMPORT_KEY_CAMEL_CASE} instead.
-     */
-    @Deprecated
-    public static final String AUTO_IMPORT_KEY_CAMEL_CASE = "autoImport";
-    /**
-     * Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints.
-     * @deprecated Use {@link Configurable#AUTO_IMPORT_KEY_SNAKE_CASE} instead.
-     */
-    @Deprecated
-    public static final String AUTO_IMPORT_KEY = AUTO_IMPORT_KEY_SNAKE_CASE;
-    
     /** Legacy, snake case ({@code like_this}) variation of the setting name. @since 2.3.23
*/
     public static final String AUTO_INCLUDE_KEY_SNAKE_CASE = "auto_include";
     /** Modern, camel case ({@code likeThis}) variation of the setting name. @since 2.3.23
*/
@@ -298,13 +279,6 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
     /** Alias to the {@code ..._SNAKE_CASE} variation due to backward compatibility constraints.
*/
     public static final String INCOMPATIBLE_IMPROVEMENTS_KEY = INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE;
     
-    /** @deprecated Use {@link #INCOMPATIBLE_IMPROVEMENTS_KEY} instead. */
-    @Deprecated
-    public static final String INCOMPATIBLE_IMPROVEMENTS = INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE;
-    /** @deprecated Use {@link #INCOMPATIBLE_IMPROVEMENTS_KEY} instead. */
-    @Deprecated
-    public static final String INCOMPATIBLE_ENHANCEMENTS = "incompatible_enhancements";
-    
     private static final String[] SETTING_NAMES_SNAKE_CASE = new String[] {
         // Must be sorted alphabetically!
         AUTO_ESCAPING_POLICY_KEY_SNAKE_CASE,
@@ -387,12 +361,6 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
     
     /** The default of {@link #getIncompatibleImprovements()}, currently {@link #VERSION_3_0_0}.
*/
     public static final Version DEFAULT_INCOMPATIBLE_IMPROVEMENTS = Configuration.VERSION_3_0_0;
-    /** @deprecated Use {@link #DEFAULT_INCOMPATIBLE_IMPROVEMENTS} instead. */
-    @Deprecated
-    public static final String DEFAULT_INCOMPATIBLE_ENHANCEMENTS = DEFAULT_INCOMPATIBLE_IMPROVEMENTS.toString();
-    /** @deprecated Use {@link #DEFAULT_INCOMPATIBLE_IMPROVEMENTS} instead. */
-    @Deprecated
-    public static final int PARSED_DEFAULT_INCOMPATIBLE_ENHANCEMENTS = DEFAULT_INCOMPATIBLE_IMPROVEMENTS.intValue();

     
     private static final String NULL = "null";
     private static final String DEFAULT = "default";
@@ -1362,31 +1330,6 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
     }
     
     /**
-     * @deprecated Use {@link #Configuration(Version)}, or
-     *    as last chance, {@link #setIncompatibleImprovements(Version)} instead.
-     */
-    @Deprecated
-    public void setIncompatibleEnhancements(String version) {
-        setIncompatibleImprovements(new Version(version));
-    }
-    
-    /**
-     * @deprecated Use {@link #getIncompatibleImprovements()} instead.
-     */
-    @Deprecated
-    public String getIncompatibleEnhancements() {
-        return incompatibleImprovements.toString();
-    }
-    
-    /**
-     * @deprecated Use {@link #getIncompatibleImprovements()} instead.
-     */
-    @Deprecated
-    public int getParsedIncompatibleEnhancements() {
-        return getIncompatibleImprovements().intValue();
-    }
-    
-    /**
      * Sets whether the FTL parser will try to remove
      * superfluous white-space around certain FTL tags.
      */
@@ -2585,8 +2528,6 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
             } else if (INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE.equals(name)
                     || INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE.equals(name)) {
                 setIncompatibleImprovements(new Version(value));
-            } else if (INCOMPATIBLE_ENHANCEMENTS.equals(name)) {
-                setIncompatibleEnhancements(value);
             } else if (TEMPLATE_LOADER_KEY_SNAKE_CASE.equals(name) || TEMPLATE_LOADER_KEY_CAMEL_CASE.equals(name))
{
                 if (value.equalsIgnoreCase(DEFAULT)) {
                     unsetTemplateLoader();
@@ -2676,6 +2617,13 @@ public class Configuration extends Configurable implements Cloneable,
ParserConf
         if ("defaultCharset".equals(name)) {
             return DEFAULT_ENCODING_KEY_CAMEL_CASE;
         }
+        if (name.equals("incompatible_enhancements")) {
+            return INCOMPATIBLE_IMPROVEMENTS_KEY_SNAKE_CASE;
+        }
+        if (name.equals("incompatibleEnhancements")) {
+            return INCOMPATIBLE_IMPROVEMENTS_KEY_CAMEL_CASE;
+        }
+        
         return super.getCorrectedNameForUnknownSetting(name);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/main/java/org/apache/freemarker/core/ast/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ast/Configurable.java b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
index 9975612..ff290c9 100644
--- a/src/main/java/org/apache/freemarker/core/ast/Configurable.java
+++ b/src/main/java/org/apache/freemarker/core/ast/Configurable.java
@@ -391,7 +391,7 @@ public class Configurable {
      * Creates a new instance. Normally you do not need to use this constructor,
      * as you don't use <code>Configurable</code> directly, but its subclasses.
      */
-    public Configurable(Configurable parent) {
+    protected Configurable(Configurable parent) {
         this.parent = parent;
         locale = null;
         numberFormat = null;
@@ -2012,10 +2012,6 @@ public class Configurable {
      *       See {@link Configuration#setIncompatibleImprovements(Version)}.
      *       <br>String value: version number like {@code 2.3.20}.
      *       
-     *   <li><p>{@code "incompatible_enhancements"}:
-     *       See: {@link Configuration#setIncompatibleEnhancements(String)}.
-     *       This setting name is deprecated, use {@code "incompatible_improvements"} instead.
-     *        
      *   <li><p>{@code "recognize_standard_file_extensions"}:
      *       See {@link Configuration#setRecognizeStandardFileExtensions(boolean)}.
      *       <br>String value: {@code "default"} (case insensitive) for the default,
or {@code "true"}, {@code "false"},

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java b/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
index 44f6bfe..8e42388 100644
--- a/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
+++ b/src/main/java/org/apache/freemarker/core/util/DeepUnwrap.java
@@ -84,15 +84,6 @@ public class DeepUnwrap {
         return unwrap(model, true);
     }
     
-    /**
-     * @deprecated the name of this method is mistyped. Use 
-     * {@link #permissiveUnwrap(TemplateModel)} instead.
-     */
-    @Deprecated
-    public static Object premissiveUnwrap(TemplateModel model) throws TemplateModelException
{
-        return unwrap(model, true);
-    }
-    
     private static Object unwrap(TemplateModel model, boolean permissive) throws TemplateModelException
{
         Environment env = Environment.getCurrentEnvironment();
         TemplateModel nullModel = null;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/_StringUtil.java b/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
index a548b77..0458b83 100644
--- a/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
+++ b/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
@@ -1099,19 +1099,6 @@ public class _StringUtil {
     }
     
     /**
-     * Used internally by the XML DOM_WRAPPER wrapper to check if the subvariable name is
just an element name, or a more
-     * complex XPath expression.
-     * 
-     * @return whether the name is a valid XML element name. (This routine might only be
99% accurate. REVISIT)
-     * 
-     * @deprecated Don't use this outside FreeMarker; it's name if misleading, and it doesn't
follow the XML specs.
-     */
-    @Deprecated
-    static public boolean isXMLID(String name) {
-        return _ExtDomApi.isXMLNameLike(name);
-    }
-    
-    /**
      * @return whether the qname matches the combination of nodeName, nsURI, and environment
prefix settings.
      */
     static public boolean matchesName(String qname, String nodeName, String nsURI, Environment
env) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java b/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
index d5f87b6..7a7aeab 100644
--- a/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
+++ b/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
@@ -621,7 +621,7 @@ public class FreemarkerServlet extends HttpServlet {
                 if (name.equals(DEPR_INITPARAM_OBJECT_WRAPPER)
                         || name.equals(Configurable.OBJECT_WRAPPER_KEY)
                         || name.equals(INIT_PARAM_TEMPLATE_PATH)
-                        || name.equals(Configuration.INCOMPATIBLE_IMPROVEMENTS)) {
+                        || name.equals(Configuration.INCOMPATIBLE_IMPROVEMENTS_KEY)) {
                     // ignore: we have already processed these
                 } else if (name.equals(DEPR_INITPARAM_ENCODING)) { // BC
                     if (getInitParameter(Configuration.DEFAULT_ENCODING_KEY) != null) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
index 90d8161..07da39c 100644
--- a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
@@ -1067,7 +1067,7 @@ public class ConfigurationTest extends TestCase {
     public void testSetICIViaSetSettingAPI() throws TemplateException {
         Configuration cfg = new Configuration();
         assertEquals(Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS, cfg.getIncompatibleImprovements());
-        cfg.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS, "3.0.0"); // This is the
only valid value ATM...
+        cfg.setSetting(Configuration.INCOMPATIBLE_IMPROVEMENTS_KEY, "3.0.0"); // This is
the only valid value ATM...
         assertEquals(Configuration.VERSION_3_0_0, cfg.getIncompatibleImprovements());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
index 2f28dab..9a59132 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestCase.java
@@ -157,7 +157,7 @@ public class TemplateTestCase extends FileTestCase {
         } else if ("input_encoding".equals(param)) {
             conf.setDefaultEncoding(value);
         // INCOMPATIBLE_IMPROVEMENTS is a list here, and was already set in the constructor.
-        } else if (!Configuration.INCOMPATIBLE_IMPROVEMENTS.equals(param)) {
+        } else if (!Configuration.INCOMPATIBLE_IMPROVEMENTS_KEY.equals(param)) {
             try {
                 conf.setSetting(param, value);
             } catch (TemplateException e) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d4dddeb7/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
index e5be937..bb15359 100644
--- a/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
+++ b/src/test/java/org/apache/freemarker/test/templatesuite/TemplateTestSuite.java
@@ -218,9 +218,7 @@ public class TemplateTestSuite extends TestSuite {
         
         final List<Version> icisToTest;
         {
-            final String testCaseIcis = testCaseSettings.get(Configuration.INCOMPATIBLE_IMPROVEMENTS)
!= null
-                    ? testCaseSettings.get(Configuration.INCOMPATIBLE_IMPROVEMENTS)
-                    : testCaseSettings.get(Configuration.INCOMPATIBLE_ENHANCEMENTS);
+            final String testCaseIcis = testCaseSettings.get(Configuration.INCOMPATIBLE_IMPROVEMENTS_KEY);
                     
             icisToTest = testCaseIcis != null ? parseVersionList(testCaseIcis) : testSuiteIcis;
             if (icisToTest.isEmpty()) {


Mime
View raw message