freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [24/50] [abbrv] incubator-freemarker git commit: (Some code cleanup)
Date Wed, 01 Mar 2017 14:21:22 GMT
(Some code cleanup)


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

Branch: refs/heads/2.3
Commit: 870f0a750df2068a073fea40186684071edba604
Parents: b5148ee
Author: ddekany <ddekany@apache.org>
Authored: Thu Feb 23 22:12:53 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Thu Feb 23 22:33:04 2017 +0100

----------------------------------------------------------------------
 src/main/java/freemarker/core/Configurable.java              | 2 +-
 src/main/java/freemarker/core/TrimInstruction.java           | 8 ++++----
 src/main/java/freemarker/core/UnaryPlusMinusExpression.java  | 4 ++--
 src/main/java/freemarker/core/_CoreAPI.java                  | 2 +-
 src/main/java/freemarker/ext/beans/BeansWrapper.java         | 2 +-
 .../freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java   | 2 +-
 src/main/java/freemarker/template/Template.java              | 8 +-------
 .../freemarker/ext/beans/ParameterListPreferabilityTest.java | 6 +++---
 .../test/templatesuite/models/OverloadedMethods2.java        | 2 +-
 .../test/templatesuite/models/TransformMethodWrapper1.java   | 2 +-
 10 files changed, 16 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/core/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/Configurable.java b/src/main/java/freemarker/core/Configurable.java
index ae14643..fd1f8f1 100644
--- a/src/main/java/freemarker/core/Configurable.java
+++ b/src/main/java/freemarker/core/Configurable.java
@@ -2768,7 +2768,7 @@ public class Configurable {
      */
     void copyDirectCustomAttributes(Configurable target, boolean overwriteExisting) {
         synchronized (customAttributes) {
-            for (Entry<? extends Object, ? extends Object> custAttrEnt : customAttributes.entrySet())
{
+            for (Entry<?, ?> custAttrEnt : customAttributes.entrySet()) {
                 Object custAttrKey = custAttrEnt.getKey();
                 if (overwriteExisting || !target.isCustomAttributeSet(custAttrKey)) {
                     if (custAttrKey instanceof String) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/core/TrimInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/TrimInstruction.java b/src/main/java/freemarker/core/TrimInstruction.java
index 7e48367..3e5d536 100644
--- a/src/main/java/freemarker/core/TrimInstruction.java
+++ b/src/main/java/freemarker/core/TrimInstruction.java
@@ -25,10 +25,10 @@ package freemarker.core;
  */
 final class TrimInstruction extends TemplateElement {
     
-    private final int TYPE_T = 0;  
-    private final int TYPE_LT = 1;  
-    private final int TYPE_RT = 2;  
-    private final int TYPE_NT = 3;  
+    private static final int TYPE_T = 0;  
+    private static final int TYPE_LT = 1;  
+    private static final int TYPE_RT = 2;  
+    private static final int TYPE_NT = 3;  
 
     final boolean left, right;
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/core/UnaryPlusMinusExpression.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/UnaryPlusMinusExpression.java b/src/main/java/freemarker/core/UnaryPlusMinusExpression.java
index 9ca17b6..8633d7f 100644
--- a/src/main/java/freemarker/core/UnaryPlusMinusExpression.java
+++ b/src/main/java/freemarker/core/UnaryPlusMinusExpression.java
@@ -26,8 +26,8 @@ import freemarker.template.TemplateNumberModel;
 
 final class UnaryPlusMinusExpression extends Expression {
     
-    private final int TYPE_MINUS = 0;
-    private final int TYPE_PLUS = 1;
+    private static final int TYPE_MINUS = 0;
+    private static final int TYPE_PLUS = 1;
 
     private final Expression target;
     private final boolean isMinus;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/core/_CoreAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/_CoreAPI.java b/src/main/java/freemarker/core/_CoreAPI.java
index df95196..a363c23 100644
--- a/src/main/java/freemarker/core/_CoreAPI.java
+++ b/src/main/java/freemarker/core/_CoreAPI.java
@@ -182,7 +182,7 @@ public class _CoreAPI {
      *             if the type of the some of the values isn't as expected
      */
     public static void checkSettingValueItemsType(String somethingsSentenceStart, Class<?>
expectedClass,
-            Collection<? extends Object> values) {
+            Collection<?> values) {
         if (values == null) return;
         for (Object value : values) {
             if (!expectedClass.isInstance(value)) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/ext/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansWrapper.java b/src/main/java/freemarker/ext/beans/BeansWrapper.java
index 71c405f..9731975 100644
--- a/src/main/java/freemarker/ext/beans/BeansWrapper.java
+++ b/src/main/java/freemarker/ext/beans/BeansWrapper.java
@@ -1007,7 +1007,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable
{
     }
 
     /**
-     * See {@try #tryUnwrap(TemplateModel, Class, int, boolean)}.
+     * See {@link #tryUnwrapTo(TemplateModel, Class, int)}.
      */
     private Object tryUnwrapTo(final TemplateModel model, Class<?> targetClass, final
int typeFlags,
             final Map<Object, Object> recursionStops) 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java b/src/main/java/freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java
index ba771e3..cba6a16 100644
--- a/src/main/java/freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java
+++ b/src/main/java/freemarker/ext/jsp/CustomTagAndELFunctionCombiner.java
@@ -42,7 +42,7 @@ import freemarker.template.utility.ClassUtil;
  * the two. As FTL as no separate namespace for "tags" and functions, both aspect has to
be implemented by the same
  * value.
  * 
- * @sine 2.3.25
+ * @since 2.3.25
  */
 @SuppressWarnings("rawtypes")
 class CustomTagAndELFunctionCombiner {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/main/java/freemarker/template/Template.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Template.java b/src/main/java/freemarker/template/Template.java
index ffef603..85f8c10 100644
--- a/src/main/java/freemarker/template/Template.java
+++ b/src/main/java/freemarker/template/Template.java
@@ -81,10 +81,6 @@ public class Template extends Configurable {
 
     private static final int READER_BUFFER_SIZE = 4096;
     
-    /** This is only non-null during parsing. It's used internally to make some information
available through the
-     *  Template API-s earlier than the parsing was finished. */
-    private transient FMParser parser;
-
     private Map macros = new HashMap();
     private List imports = new Vector();
     private TemplateElement rootElement;
@@ -245,7 +241,7 @@ public class Template extends Configurable {
             reader = ltbReader;
             
             try {
-                parser = new FMParser(this, reader, actualParserConfiguration);
+                FMParser parser = new FMParser(this, reader, actualParserConfiguration);
                 try {
                     this.rootElement = parser.Root();
                 } catch (IndexOutOfBoundsException exc) {
@@ -263,8 +259,6 @@ public class Template extends Configurable {
                 // TokenMgrError VS ParseException is not an interesting difference for the
user, so we just convert it
                 // to ParseException
                 throw exc.toParseException(this);
-            } finally {
-                parser = null;
             }
         } catch (ParseException e) {
             e.setTemplateName(getSourceName());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/test/java/freemarker/ext/beans/ParameterListPreferabilityTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/ext/beans/ParameterListPreferabilityTest.java b/src/test/java/freemarker/ext/beans/ParameterListPreferabilityTest.java
index c577f93..5096110 100644
--- a/src/test/java/freemarker/ext/beans/ParameterListPreferabilityTest.java
+++ b/src/test/java/freemarker/ext/beans/ParameterListPreferabilityTest.java
@@ -27,8 +27,8 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.TreeMap;
 
-import junit.framework.TestCase;
 import freemarker.template.utility.NumberUtil;
+import junit.framework.TestCase;
 
 @SuppressWarnings("boxing")
 public class ParameterListPreferabilityTest extends TestCase {
@@ -313,7 +313,7 @@ public class ParameterListPreferabilityTest extends TestCase {
                 },
                 new Object[] { "a", "b" });
         
-        /** Subclassing is more important than primitive-VS-boxed: */
+        // Subclassing is more important than primitive-VS-boxed:
         testAllCmpPermutationsInc(
                 new Class[][] {
                     new Class[] { boolean.class, boolean.class, boolean.class, String.class
},
@@ -332,7 +332,7 @@ public class ParameterListPreferabilityTest extends TestCase {
                 },
                 new Object[] { true, false, true, "a" });
         
-        /** Subclassing is more important than primitive-VS-boxed: */
+        // Subclassing is more important than primitive-VS-boxed:
         testAllCmpPermutationsInc(
                 new Class[][] {
                     new Class[] { int.class, int.class, int.class, String.class },

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/test/java/freemarker/test/templatesuite/models/OverloadedMethods2.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/templatesuite/models/OverloadedMethods2.java b/src/test/java/freemarker/test/templatesuite/models/OverloadedMethods2.java
index 833e590..854c179 100644
--- a/src/test/java/freemarker/test/templatesuite/models/OverloadedMethods2.java
+++ b/src/test/java/freemarker/test/templatesuite/models/OverloadedMethods2.java
@@ -1004,7 +1004,7 @@ public class OverloadedMethods2 {
         return new MyBooleanWrapperAsAnotherBooleanModel(); 
     }
     
-    public String bugReport363(Map<String, ? extends Object> fields, List<?>
listField) {
+    public String bugReport363(Map<String, ?> fields, List<?> listField) {
         return "Executed: testMethod(Map fields, List listField) on input: fields=" + fields
                 + " and listField=" + listField;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/870f0a75/src/test/java/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
b/src/test/java/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
index bfb2a34..8c2db7a 100644
--- a/src/test/java/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
+++ b/src/test/java/freemarker/test/templatesuite/models/TransformMethodWrapper1.java
@@ -28,7 +28,7 @@ import freemarker.template.utility.XmlEscape;
 /**
  * Simple test of the interaction between MethodModels and TransformModels.
  */
-public class TransformMethodWrapper1 extends Object implements TemplateMethodModel {
+public class TransformMethodWrapper1 implements TemplateMethodModel {
 
     /**
      * Executes a method call.


Mime
View raw message