freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [54/54] incubator-freemarker git commit: (Some code cleanup)
Date Thu, 23 Feb 2017 21:36:21 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/983ad9bd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/983ad9bd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/983ad9bd

Branch: refs/heads/3
Commit: 983ad9bd1f63dece4e5bf619195f6e960c13e54e
Parents: 0a8f9d1
Author: ddekany <ddekany@apache.org>
Authored: Thu Feb 23 22:34:13 2017 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Thu Feb 23 22:34:13 2017 +0100

----------------------------------------------------------------------
 .../freemarker/core/ASTDirAssignment.java       |  3 +-
 .../org/apache/freemarker/core/ASTDirList.java  | 12 +++----
 .../apache/freemarker/core/ASTDirSwitch.java    |  4 ++-
 .../apache/freemarker/core/ASTDirTOrTrOrTl.java |  8 ++---
 .../freemarker/core/ASTExpAddOrConcat.java      |  2 +-
 .../freemarker/core/ASTExpDynamicKeyName.java   |  2 +-
 .../freemarker/core/ASTExpNegateOrPlus.java     |  4 +--
 .../freemarker/core/ASTHashInterpolation.java   |  3 +-
 .../freemarker/core/ArithmeticExpression.java   |  2 +-
 .../freemarker/core/BuiltInsForNumbers.java     | 14 ++++----
 .../freemarker/core/BuiltInsForSequences.java   |  4 +--
 .../freemarker/core/BuiltInsForStringsMisc.java | 12 +++----
 .../apache/freemarker/core/Configurable.java    |  2 +-
 .../apache/freemarker/core/Configuration.java   |  8 ++---
 .../apache/freemarker/core/CustomAttribute.java |  8 ++---
 .../org/apache/freemarker/core/Environment.java |  7 ++--
 .../org/apache/freemarker/core/EvalUtil.java    | 13 +++----
 .../org/apache/freemarker/core/MessageUtil.java |  2 +-
 .../NonStringOrTemplateOutputException.java     |  4 +--
 .../apache/freemarker/core/RegexpHelper.java    |  2 +-
 .../org/apache/freemarker/core/Template.java    | 11 ++----
 .../freemarker/core/TemplateException.java      |  4 +--
 .../apache/freemarker/core/TokenMgrError.java   |  2 +-
 .../org/apache/freemarker/core/_CoreAPI.java    |  8 ++---
 .../core/_ErrorDescriptionBuilder.java          |  3 +-
 .../debug/impl/RmiDebuggedEnvironmentImpl.java  | 36 ++++++++------------
 .../core/debug/impl/RmiDebuggerService.java     |  2 +-
 .../core/model/AdapterTemplateModel.java        |  2 +-
 .../model/SerializableTemplateBooleanModel.java |  2 +-
 .../core/model/TemplateCollectionModel.java     |  2 +-
 .../core/model/TemplateDateModel.java           | 18 +++++-----
 .../core/model/TemplateDirectiveBody.java       |  2 +-
 .../core/model/TemplateDirectiveModel.java      |  4 +--
 .../core/model/TemplateMethodModel.java         |  2 +-
 .../core/model/TemplateMethodModelEx.java       |  2 +-
 .../core/model/TemplateModelAdapter.java        |  2 +-
 .../core/model/TemplateNumberModel.java         |  2 +-
 .../core/model/TemplateScalarModel.java         |  4 +--
 .../freemarker/core/model/TransformControl.java | 14 ++++----
 .../core/model/WrapperTemplateModel.java        |  2 +-
 .../freemarker/core/model/impl/SimpleHash.java  |  1 +
 .../core/model/impl/beans/BeansWrapper.java     |  6 ++--
 .../impl/beans/BeansWrapperConfiguration.java   |  4 +--
 .../impl/beans/ClassIntrospectorBuilder.java    |  4 +--
 .../beans/EmptyCallableMemberDescriptor.java    |  4 +--
 .../core/model/impl/beans/ModelCache.java       |  4 +--
 .../model/impl/beans/OverloadedNumberUtil.java  | 16 ++++-----
 .../core/model/impl/beans/SimpleMethod.java     |  3 +-
 .../core/model/impl/beans/UnsafeMethods.java    |  2 +-
 .../freemarker/core/model/impl/dom/AtAtKey.java |  2 +-
 .../core/model/impl/dom/DocumentTypeModel.java  |  2 +-
 .../core/model/impl/dom/JaxenXPathSupport.java  |  5 ++-
 .../core/model/impl/dom/NodeModel.java          |  6 ++--
 .../core/templateresolver/CacheStorage.java     |  8 ++---
 .../TemplateConfigurationFactory.java           |  1 -
 .../templateresolver/TemplateLoaderSession.java |  4 +--
 .../core/templateresolver/TemplateResolver.java |  2 +-
 .../impl/DefaultTemplateResolver.java           |  4 +--
 .../apache/freemarker/core/util/_ClassUtil.java |  4 +--
 .../freemarker/core/util/_NumberUtil.java       | 12 +++----
 .../freemarker/core/util/_StringUtil.java       | 14 ++++----
 .../freemarker/servlet/FreemarkerServlet.java   |  4 +--
 .../servlet/WebAppTemplateLoader.java           |  2 +-
 .../jsp/CustomTagAndELFunctionCombiner.java     |  4 +--
 .../servlet/jsp/FreeMarkerPageContext.java      |  2 --
 .../freemarker/servlet/jsp/JspTagModelBase.java |  2 +-
 .../freemarker/servlet/jsp/TaglibFactory.java   | 14 ++++----
 .../freemarker/core/CanonicalFormTest.java      |  2 +-
 .../freemarker/core/CustomAttributeTest.java    |  2 +-
 .../core/ObjectBuilderSettingsTest.java         |  3 +-
 .../org/apache/freemarker/core/TabSizeTest.java |  5 ++-
 .../core/TagSyntaxVariationsTest.java           |  2 +-
 .../freemarker/core/TemplatGetEncodingTest.java |  2 +-
 .../core/TemplateConstructorsTest.java          |  4 +--
 .../core/TheadInterruptingSupportTest.java      |  1 +
 .../model/impl/DefaultObjectWrapperTest.java    |  6 ++--
 .../CommonSupertypeForUnwrappingHintTest.java   |  4 +--
 .../core/model/impl/beans/EnumModelsTest.java   |  2 +-
 .../beans/ParameterListPreferabilityTest.java   |  4 +--
 .../DefaultTemplateResolverTest.java            |  2 +-
 .../MultiTemplateLoaderTest.java                |  4 +--
 .../TemplateNameFormatTest.java                 |  4 +--
 .../freemarker/manualtest/ExamplesTest.java     |  6 ++--
 .../TemplateConfigurationExamples.java          |  4 +--
 .../freemarker/servlet/jsp/TLDParsingTest.java  |  4 +--
 .../servlet/jsp/TaglibMethodUtilTest.java       | 12 +++----
 .../jsp/taglibmembers/TestFunctions.java        |  2 +-
 .../servlet/jsp/taglibmembers/TestTag.java      |  2 +-
 .../test/MonitoredTemplateLoader.java           |  4 +--
 .../freemarker/test/ResourcesExtractor.java     |  2 +-
 .../apache/freemarker/test/TemplateTest.java    |  6 ++--
 .../freemarker/test/servlet/Model2Action.java   |  2 +-
 .../test/templatesuite/TemplateTestCase.java    |  2 +-
 .../test/templatesuite/TemplateTestSuite.java   |  2 +-
 .../test/templatesuite/models/Listables.java    |  8 ++---
 .../models/OverloadedMethods2.java              |  2 +-
 .../models/TransformMethodWrapper1.java         |  2 +-
 .../freemarker/test/util/FileTestCase.java      | 10 +++---
 98 files changed, 222 insertions(+), 271 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java b/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
index 8b85fc6..734e6eb 100644
--- a/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
+++ b/src/main/java/org/apache/freemarker/core/ASTDirAssignment.java
@@ -208,8 +208,7 @@ final class ASTDirAssignment extends _ASTElement {
             }
             if (canonical) buf.append(">");
         }
-        String result = buf.toString();
-        return result;
+        return buf.toString();
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTDirList.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTDirList.java b/src/main/java/org/apache/freemarker/core/ASTDirList.java
index c56a676..4d9f54a 100644
--- a/src/main/java/org/apache/freemarker/core/ASTDirList.java
+++ b/src/main/java/org/apache/freemarker/core/ASTDirList.java
@@ -239,8 +239,8 @@ final class ASTDirList extends _ASTElement {
         }
 
         void loopForItemsElement(Environment env, _ASTElement[] childBuffer, String loopVarName, String loopVar2Name)
-                    throws NonSequenceOrCollectionException, TemplateModelException, InvalidReferenceException,
-                    TemplateException, IOException {
+                    throws
+                TemplateException, IOException {
             try {
                 if (alreadyEntered) {
                     throw new _MiscTemplateException(env,
@@ -261,16 +261,14 @@ final class ASTDirList extends _ASTElement {
          * each list item once, otherwise once if {@link #listedValue} isn't empty.
          */
         private boolean executeNestedContent(Environment env, _ASTElement[] childBuffer)
-                throws TemplateModelException, TemplateException, IOException, NonSequenceOrCollectionException,
-                InvalidReferenceException {
+                throws TemplateException, IOException {
             return !hashListing
                     ? executedNestedContentForCollOrSeqListing(env, childBuffer)
                     : executedNestedContentForHashListing(env, childBuffer);
         }
 
         private boolean executedNestedContentForCollOrSeqListing(Environment env, _ASTElement[] childBuffer)
-                throws TemplateModelException, IOException, TemplateException,
-                NonSequenceOrCollectionException, InvalidReferenceException {
+                throws IOException, TemplateException {
             final boolean listNotEmpty;
             if (listedValue instanceof TemplateCollectionModel) {
                 final TemplateCollectionModel collModel = (TemplateCollectionModel) listedValue;
@@ -333,7 +331,7 @@ final class ASTDirList extends _ASTElement {
         }
 
         private boolean executedNestedContentForHashListing(Environment env, _ASTElement[] childBuffer)
-                throws TemplateModelException, IOException, TemplateException {
+                throws IOException, TemplateException {
             final boolean hashNotEmpty;
             if (listedValue instanceof TemplateHashModelEx) {
                 TemplateHashModelEx listedHash = (TemplateHashModelEx) listedValue; 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java b/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
index de56bf3..6d1218e 100644
--- a/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
+++ b/src/main/java/org/apache/freemarker/core/ASTDirSwitch.java
@@ -74,7 +74,9 @@ final class ASTDirSwitch extends _ASTElement {
             if (!processedCase && defaultCase != null) {
                 env.visit(defaultCase);
             }
-        } catch (ASTDirBreak.Break br) {}
+        } catch (ASTDirBreak.Break br) {
+            // #break was called
+        }
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java b/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
index c5f2182..7efccf4 100644
--- a/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
+++ b/src/main/java/org/apache/freemarker/core/ASTDirTOrTrOrTl.java
@@ -24,10 +24,10 @@ package org.apache.freemarker.core;
  */
 final class ASTDirTOrTrOrTl extends _ASTElement {
     
-    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/983ad9bd/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java b/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
index 7b2369a..569db70 100644
--- a/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
+++ b/src/main/java/org/apache/freemarker/core/ASTExpAddOrConcat.java
@@ -65,7 +65,7 @@ final class ASTExpAddOrConcat extends ASTExpression {
             ASTNode parent,
             ASTExpression leftExp, TemplateModel leftModel,
             ASTExpression rightExp, TemplateModel rightModel)
-            throws TemplateModelException, TemplateException, NonStringException {
+            throws TemplateException {
         if (leftModel instanceof TemplateNumberModel && rightModel instanceof TemplateNumberModel) {
             Number first = EvalUtil.modelToNumber((TemplateNumberModel) leftModel, leftExp);
             Number second = EvalUtil.modelToNumber((TemplateNumberModel) rightModel, rightExp);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java b/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
index 017745e..96eec38 100644
--- a/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
+++ b/src/main/java/org/apache/freemarker/core/ASTExpDynamicKeyName.java
@@ -128,7 +128,7 @@ final class ASTExpDynamicKeyName extends ASTExpression {
     }
 
     private TemplateModel dealWithRangeKey(TemplateModel targetModel, RangeModel range, Environment env)
-    throws UnexpectedTypeException, InvalidReferenceException, TemplateException {
+    throws TemplateException {
         final TemplateSequenceModel targetSeq;
         final String targetStr;
         if (targetModel instanceof TemplateSequenceModel) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java b/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
index 753202b..f007442 100644
--- a/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
+++ b/src/main/java/org/apache/freemarker/core/ASTExpNegateOrPlus.java
@@ -28,8 +28,8 @@ import org.apache.freemarker.core.model.impl.SimpleNumber;
  */
 final class ASTExpNegateOrPlus extends ASTExpression {
     
-    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 ASTExpression target;
     private final boolean isMinus;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java b/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
index 93a95c5..4cd3e7f 100644
--- a/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
+++ b/src/main/java/org/apache/freemarker/core/ASTHashInterpolation.java
@@ -95,8 +95,7 @@ final class ASTHashInterpolation extends ASTInterpolation {
         // We must use Format even if hasFormat == false.
         // Some locales may use non-Arabic digits, thus replacing the
         // decimal separator in the result of toString() is not enough.
-        String s = fmth.format.format(num);
-        return s;
+        return fmth.format.format(num);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/ArithmeticExpression.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/ArithmeticExpression.java b/src/main/java/org/apache/freemarker/core/ArithmeticExpression.java
index f477b95..5b7bfe4 100644
--- a/src/main/java/org/apache/freemarker/core/ArithmeticExpression.java
+++ b/src/main/java/org/apache/freemarker/core/ArithmeticExpression.java
@@ -51,7 +51,7 @@ final class ArithmeticExpression extends ASTExpression {
     }
 
     static TemplateModel _eval(Environment env, ASTNode parent, Number lhoNumber, int operator, Number rhoNumber)
-            throws TemplateException, _MiscTemplateException {
+            throws TemplateException {
         ArithmeticEngine ae = EvalUtil.getArithmeticEngine(env, parent); 
         switch (operator) {
             case TYPE_SUBSTRACTION : 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/BuiltInsForNumbers.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/BuiltInsForNumbers.java b/src/main/java/org/apache/freemarker/core/BuiltInsForNumbers.java
index 8e0d9af..2275d86 100644
--- a/src/main/java/org/apache/freemarker/core/BuiltInsForNumbers.java
+++ b/src/main/java/org/apache/freemarker/core/BuiltInsForNumbers.java
@@ -84,7 +84,7 @@ class BuiltInsForNumbers {
         @Override
         TemplateModel calculateResult(Number num, TemplateModel model) throws TemplateModelException {
             if (num instanceof Integer) {
-                int n = ((Integer) num).intValue();
+                int n = num.intValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
@@ -98,35 +98,35 @@ class BuiltInsForNumbers {
                     return model;
                 }
             } else if (num instanceof Double) {
-                double n = ((Double) num).doubleValue();
+                double n = num.doubleValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
                     return model;
                 }
             } else if (num instanceof Float) {
-                float n = ((Float) num).floatValue();
+                float n = num.floatValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
                     return model;
                 }
             } else if (num instanceof Long) {
-                long n = ((Long) num).longValue();
+                long n = num.longValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
                     return model;
                 }
             } else if (num instanceof Short) {
-                short n = ((Short) num).shortValue();
+                short n = num.shortValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
                     return model;
                 }
             } else if (num instanceof Byte) {
-                byte n = ((Byte) num).byteValue();
+                byte n = num.byteValue();
                 if (n < 0) {
                     return new SimpleNumber(-n);
                 } else {
@@ -267,7 +267,7 @@ class BuiltInsForNumbers {
         }
     }
 
-    private static final long safeToLong(Number num) throws TemplateModelException {
+    private static long safeToLong(Number num) throws TemplateModelException {
         if (num instanceof Double) {
             double d = Math.round(num.doubleValue());
             if (d > Long.MAX_VALUE || d < Long.MIN_VALUE) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/BuiltInsForSequences.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/BuiltInsForSequences.java b/src/main/java/org/apache/freemarker/core/BuiltInsForSequences.java
index 142d924..39ae949 100644
--- a/src/main/java/org/apache/freemarker/core/BuiltInsForSequences.java
+++ b/src/main/java/org/apache/freemarker/core/BuiltInsForSequences.java
@@ -848,9 +848,7 @@ class BuiltInsForSequences {
 
     private static boolean isBuggySeqButGoodCollection(
             TemplateModel model) {
-        return model instanceof CollectionModel
-                ? !((CollectionModel) model).getSupportsIndexedAccess()
-                : false;
+        return model instanceof CollectionModel && !((CollectionModel) model).getSupportsIndexedAccess();
     }
     
     private static boolean modelsEqual(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/BuiltInsForStringsMisc.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/BuiltInsForStringsMisc.java b/src/main/java/org/apache/freemarker/core/BuiltInsForStringsMisc.java
index 2f885a5..12e1207 100644
--- a/src/main/java/org/apache/freemarker/core/BuiltInsForStringsMisc.java
+++ b/src/main/java/org/apache/freemarker/core/BuiltInsForStringsMisc.java
@@ -185,12 +185,12 @@ class BuiltInsForStringsMisc {
                         parentTemplate.getConfiguration(), pCfg,
                         null);
             } catch (IOException e) {
-                throw new _MiscTemplateException(this, e, env, new Object[] {
-                            "Template parsing with \"?", key, "\" has failed with this error:\n\n",
-                            MessageUtil.EMBEDDED_MESSAGE_BEGIN,
-                            new _DelayedGetMessage(e),
-                            MessageUtil.EMBEDDED_MESSAGE_END,
-                            "\n\nThe failed expression:" });
+                throw new _MiscTemplateException(this, e, env,
+                        "Template parsing with \"?", key, "\" has failed with this error:\n\n",
+                        MessageUtil.EMBEDDED_MESSAGE_BEGIN,
+                        new _DelayedGetMessage(e),
+                        MessageUtil.EMBEDDED_MESSAGE_END,
+                        "\n\nThe failed expression:");
             }
             
             interpretedTemplate.setLocale(env.getLocale());

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/Configurable.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Configurable.java b/src/main/java/org/apache/freemarker/core/Configurable.java
index a5ef09b..f90a8ed 100644
--- a/src/main/java/org/apache/freemarker/core/Configurable.java
+++ b/src/main/java/org/apache/freemarker/core/Configurable.java
@@ -2450,7 +2450,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/983ad9bd/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 8e4cfd1..3eba432 100644
--- a/src/main/java/org/apache/freemarker/core/Configuration.java
+++ b/src/main/java/org/apache/freemarker/core/Configuration.java
@@ -549,7 +549,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
     }
     
     // Package visible as Configurable needs this to initialize the field defaults.
-    final static TemplateExceptionHandler getDefaultTemplateExceptionHandler(Version incompatibleImprovements) {
+    static TemplateExceptionHandler getDefaultTemplateExceptionHandler(Version incompatibleImprovements) {
         return TemplateExceptionHandler.DEBUG_HANDLER;
     }
     
@@ -1467,8 +1467,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
             throw new IllegalArgumentException("The \"" + outerName + "\" output format can't be used in "
                     + "...{...} expression, because it's not a markup format.");
         }
-        MarkupOutputFormat outerOF = (MarkupOutputFormat) of;
-        return outerOF;
+        return (MarkupOutputFormat) of;
     }
     
     /**
@@ -2587,8 +2586,7 @@ public class Configuration extends Configurable implements Cloneable, ParserConf
         }
     }
     
-    private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException,
-            TemplateNotFoundException, MalformedTemplateNameException, ParseException {
+    private void doAutoIncludes(Environment env, Template t) throws TemplateException, IOException {
         // We can't store autoIncludes in LinkedHashSet-s because setAutoIncludes(List) allows duplicates,
         // unfortunately. Yet we have to prevent duplicates among Configuration levels, with the lowest levels having
         // priority. So we build some Set-s to do that, but we avoid the most common cases where they aren't needed.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/CustomAttribute.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/CustomAttribute.java b/src/main/java/org/apache/freemarker/core/CustomAttribute.java
index 3dee398..b808c6d 100644
--- a/src/main/java/org/apache/freemarker/core/CustomAttribute.java
+++ b/src/main/java/org/apache/freemarker/core/CustomAttribute.java
@@ -127,7 +127,7 @@ public class CustomAttribute {
         if (scope != SCOPE_TEMPLATE) {
             throw new UnsupportedOperationException("This is not a template-scope attribute");
         }
-        return ((Configurable) template).getCustomAttribute(key, this);
+        return template.getCustomAttribute(key, this);
     }
     
     /**
@@ -156,7 +156,7 @@ public class CustomAttribute {
         if (scope != SCOPE_CONFIGURATION) {
             throw new UnsupportedOperationException("This is not a template-scope attribute");
         }
-        return ((Configurable) cfg).getCustomAttribute(key, this);
+        return cfg.getCustomAttribute(key, this);
     }
     
     /**
@@ -205,7 +205,7 @@ public class CustomAttribute {
         if (scope != SCOPE_TEMPLATE) {
             throw new UnsupportedOperationException("This is not a template-scope attribute");
         }
-        ((Configurable) template).setCustomAttribute(key, value);
+        template.setCustomAttribute(key, value);
     }
 
     /**
@@ -237,7 +237,7 @@ public class CustomAttribute {
         if (scope != SCOPE_CONFIGURATION) {
             throw new UnsupportedOperationException("This is not a configuration-scope attribute");
         }
-        ((Configurable) cfg).setCustomAttribute(key, value);
+        cfg.setCustomAttribute(key, value);
     }
     
     private Environment getRequiredCurrentEnvironment() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Environment.java b/src/main/java/org/apache/freemarker/core/Environment.java
index 36eccb9..ef1602e 100644
--- a/src/main/java/org/apache/freemarker/core/Environment.java
+++ b/src/main/java/org/apache/freemarker/core/Environment.java
@@ -691,7 +691,7 @@ public final class Environment extends Configurable {
     private void setMacroContextLocalsFromArguments(
             final ASTDirMacro.Context macroCtx,
             final ASTDirMacro macro,
-            final Map namedArgs, final List positionalArgs) throws TemplateException, _MiscTemplateException {
+            final Map namedArgs, final List positionalArgs) throws TemplateException {
         String catchAllParamName = macro.getCatchAll();
         if (namedArgs != null) {
             final SimpleHash catchAllParamValue;
@@ -1517,13 +1517,12 @@ public final class Environment extends Configurable {
     }
     
     TemplateDateFormat getTemplateDateFormat(TemplateDateModel tdm, ASTExpression tdmSourceExpr, boolean useTempModelExc)
-            throws TemplateModelException, TemplateException {
+            throws TemplateException {
         Date date = EvalUtil.modelToDate(tdm, tdmSourceExpr);
         
-        TemplateDateFormat format = getTemplateDateFormat(
+        return getTemplateDateFormat(
                 tdm.getDateType(), date.getClass(), tdmSourceExpr,
                 useTempModelExc);
-        return format;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/EvalUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/EvalUtil.java b/src/main/java/org/apache/freemarker/core/EvalUtil.java
index 6889232..5036a36 100644
--- a/src/main/java/org/apache/freemarker/core/EvalUtil.java
+++ b/src/main/java/org/apache/freemarker/core/EvalUtil.java
@@ -114,8 +114,8 @@ class EvalUtil {
     
     /**
      * Compares values according the rules of the FTL comparator operators; if the {@link ASTExpression}-s are
-     * accessible, use {@link #compare(ASTExpression, int, String, ASTExpression, ASTExpression, Environment)} instead, as
-     * that gives better error messages.
+     * accessible, use {@link #compare(ASTExpression, int, String, ASTExpression, ASTExpression, Environment)} instead,
+     * as that gives better error messages.
      * 
      * @param leftValue maybe {@code null}, which will usually cause the appropriate {@link TemplateException}. 
      * @param operator one of the {@code COMP_OP_...} constants, like {@link #CMP_OP_EQUALS}.
@@ -217,8 +217,8 @@ class EvalUtil {
             try {
                 cmpResult = ae.compareNumbers(leftNum, rightNum);
             } catch (RuntimeException e) {
-                throw new _MiscTemplateException(defaultBlamed, e, env, new Object[]
-                        { "Unexpected error while comparing two numbers: ", e });
+                throw new _MiscTemplateException(defaultBlamed, e, env,
+                        "Unexpected error while comparing two numbers: ", e);
             }
         } else if (leftValue instanceof TemplateDateModel && rightValue instanceof TemplateDateModel) {
             TemplateDateModel leftDateModel = (TemplateDateModel) leftValue;
@@ -243,7 +243,6 @@ class EvalUtil {
             }
             
             if (leftDateType != rightDateType) {
-                ;
                 throw new _MiscTemplateException(defaultBlamed, env,
                         "Can't compare dates of different types. Left date type is ",
                         TemplateDateModel.TYPE_NAMES.get(leftDateType), ", right date type is ",
@@ -330,7 +329,6 @@ class EvalUtil {
      *            Tip to display if the value type is not coercable, but it's sequence or collection.
      * 
      * @return Never {@code null}
-     * @throws TemplateException 
      */
     static Object coerceModelToStringOrMarkup(TemplateModel tm, ASTExpression exp, String seqTip, Environment env)
             throws TemplateException {
@@ -434,8 +432,7 @@ class EvalUtil {
     private static String coerceModelToTextualCommon(
             TemplateModel tm, ASTExpression exp, String seqHint, boolean supportsTOM, boolean returnNullOnNonCoercableType,
             Environment env)
-            throws TemplateModelException, InvalidReferenceException, TemplateException,
-                    NonStringOrTemplateOutputException, NonStringException {
+            throws TemplateException {
         if (tm instanceof TemplateScalarModel) {
             return modelToString((TemplateScalarModel) tm, exp, env);
         } else if (tm == null) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/MessageUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/MessageUtil.java b/src/main/java/org/apache/freemarker/core/MessageUtil.java
index 6787411..c0f6a96 100644
--- a/src/main/java/org/apache/freemarker/core/MessageUtil.java
+++ b/src/main/java/org/apache/freemarker/core/MessageUtil.java
@@ -134,7 +134,7 @@ class MessageUtil {
         if (brIdx != -1) {
             s = s.substring(0, brIdx);
             isTruncated = true;
-        };
+        }
         brIdx = s.indexOf('\r');
         if (brIdx != -1) {
             s = s.substring(0, brIdx);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/NonStringOrTemplateOutputException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/NonStringOrTemplateOutputException.java b/src/main/java/org/apache/freemarker/core/NonStringOrTemplateOutputException.java
index 73454e6..4374f2d 100644
--- a/src/main/java/org/apache/freemarker/core/NonStringOrTemplateOutputException.java
+++ b/src/main/java/org/apache/freemarker/core/NonStringOrTemplateOutputException.java
@@ -39,8 +39,8 @@ public class NonStringOrTemplateOutputException extends UnexpectedTypeException
             STRING_COERCABLE_TYPES_AND_TOM[i] = NonStringException.STRING_COERCABLE_TYPES[i];
         }
         STRING_COERCABLE_TYPES_AND_TOM[i] = TemplateMarkupOutputModel.class;
-    };
-    
+    }
+
     private static final String DEFAULT_DESCRIPTION
             = "Expecting " + NonStringOrTemplateOutputException.STRING_COERCABLE_TYPES_OR_TOM_DESC + " value here";
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/RegexpHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/RegexpHelper.java b/src/main/java/org/apache/freemarker/core/RegexpHelper.java
index 1c865a3..a403b0c 100644
--- a/src/main/java/org/apache/freemarker/core/RegexpHelper.java
+++ b/src/main/java/org/apache/freemarker/core/RegexpHelper.java
@@ -85,7 +85,7 @@ final class RegexpHelper {
             patternCache.put(patternKey, result);
         }
         return result;
-    };
+    }
 
     private static class PatternCacheKey {
         private final String patternString;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/Template.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/Template.java b/src/main/java/org/apache/freemarker/core/Template.java
index 77c92c4..8888aaf 100644
--- a/src/main/java/org/apache/freemarker/core/Template.java
+++ b/src/main/java/org/apache/freemarker/core/Template.java
@@ -68,10 +68,6 @@ public class Template extends Configurable {
 
     private static final int READER_BUFFER_SIZE = 8192;
     
-    /** 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 _ASTElement rootElement;
@@ -216,8 +212,7 @@ public class Template extends Configurable {
 
     /**
      * Same as {@link #Template(String, String, Reader, Configuration, ParserConfiguration, String)}, but allows
-     * specifying a non-default (non-{@link TemplateSpecifiedEncodingHandler#DEFAULT}) behavior regarding encoding
-     * specified in the template content.
+     * specifying the {@code streamToUnmarkWhenEncEstabd} {@link InputStream}.
      *
      * @param streamToUnmarkWhenEncEstabd
      *         If not {@code null}, when during the parsing we reach a point where we know that no {@link
@@ -248,7 +243,7 @@ public class Template extends Configurable {
             reader = ltbReader;
             
             try {
-                parser = _CoreAPI.newFMParser(
+                FMParser parser = _CoreAPI.newFMParser(
                         this, reader, actualParserConfiguration, streamToUnmarkWhenEncEstabd);
                 try {
                     rootElement = parser.Root();
@@ -267,8 +262,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/983ad9bd/src/main/java/org/apache/freemarker/core/TemplateException.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/TemplateException.java b/src/main/java/org/apache/freemarker/core/TemplateException.java
index 4ed9beb..d40d828 100644
--- a/src/main/java/org/apache/freemarker/core/TemplateException.java
+++ b/src/main/java/org/apache/freemarker/core/TemplateException.java
@@ -53,7 +53,6 @@ public class TemplateException extends Exception {
     private boolean blamedExpressionStringCalculated;
     private String blamedExpressionString;
     private boolean positionsCalculated;
-    private String templateName;
     private String templateSourceName;
     private Integer lineNumber; 
     private Integer columnNumber; 
@@ -194,7 +193,6 @@ public class TemplateException extends Exception {
                 // Line number blow 0 means no info, negative means position in ?eval-ed value that we won't use here.
                 if (templateObject != null && templateObject.getBeginLine() > 0) {
                     final Template template = templateObject.getTemplate();
-                    templateName = template != null ? template.getName() : null;
                     templateSourceName = template != null ? template.getSourceName() : null;
                     lineNumber = Integer.valueOf(templateObject.getBeginLine());
                     columnNumber = Integer.valueOf(templateObject.getBeginColumn());
@@ -389,7 +387,7 @@ public class TemplateException extends Exception {
                                 out.printStandardStackTrace(rootCause);
                             }
                         } catch (Throwable exc) {
-                            ; // ignore
+                            // ignore
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/TokenMgrError.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/TokenMgrError.java b/src/main/java/org/apache/freemarker/core/TokenMgrError.java
index adddcf7..ef60bc4 100644
--- a/src/main/java/org/apache/freemarker/core/TokenMgrError.java
+++ b/src/main/java/org/apache/freemarker/core/TokenMgrError.java
@@ -68,7 +68,7 @@ public class TokenMgrError extends Error {
     * Replaces unprintable characters by their espaced (or unicode escaped)
     * equivalents in the given string
     */
-   protected static final String addEscapes(String str) {
+   protected static String addEscapes(String str) {
       StringBuilder retval = new StringBuilder();
       char ch;
       for (int i = 0; i < str.length(); i++) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/_CoreAPI.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/_CoreAPI.java b/src/main/java/org/apache/freemarker/core/_CoreAPI.java
index 5f51bd4..5fb8de2 100644
--- a/src/main/java/org/apache/freemarker/core/_CoreAPI.java
+++ b/src/main/java/org/apache/freemarker/core/_CoreAPI.java
@@ -158,7 +158,7 @@ public class _CoreAPI {
      * ATTENTION: This is used by https://github.com/kenshoo/freemarker-online. Don't break backward
      * compatibility without updating that project too! 
      */
-    static final public void addThreadInterruptedChecks(Template template) {
+    static public void addThreadInterruptedChecks(Template template) {
         try {
             new ThreadInterruptionSupportTemplatePostProcessor().postProcess(template);
         } catch (TemplatePostProcessorException e) {
@@ -166,12 +166,12 @@ public class _CoreAPI {
         }
     }
     
-    static final public void checkHasNoNestedContent(TemplateDirectiveBody body)
+    static public void checkHasNoNestedContent(TemplateDirectiveBody body)
             throws NestedContentNotSupportedException {
         NestedContentNotSupportedException.check(body);
     }
     
-    static final public void replaceText(ASTStaticText textBlock, String text) {
+    static public void replaceText(ASTStaticText textBlock, String text) {
         textBlock.replaceText(text);
     }
 
@@ -180,7 +180,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/983ad9bd/src/main/java/org/apache/freemarker/core/_ErrorDescriptionBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/_ErrorDescriptionBuilder.java b/src/main/java/org/apache/freemarker/core/_ErrorDescriptionBuilder.java
index 9dc789a..d9fd3a0 100644
--- a/src/main/java/org/apache/freemarker/core/_ErrorDescriptionBuilder.java
+++ b/src/main/java/org/apache/freemarker/core/_ErrorDescriptionBuilder.java
@@ -270,8 +270,7 @@ public class _ErrorDescriptionBuilder {
     private String[] splitToLines(String s) {
         s = _StringUtil.replace(s, "\r\n", "\n");
         s = _StringUtil.replace(s, "\r", "\n");
-        String[] lines = _StringUtil.split(s, '\n');
-        return lines;
+        return _StringUtil.split(s, '\n');
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
index fdfa0e1..94c9097 100644
--- a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
+++ b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggedEnvironmentImpl.java
@@ -161,15 +161,13 @@ class RmiDebuggedEnvironmentImpl extends RmiDebugModelImpl implements DebuggedEn
     }
     
     private static class DebugConfigurableModel extends DebugMapModel {
-        static final List KEYS = Arrays.asList(new String[]
-        {
-            Configurable.ARITHMETIC_ENGINE_KEY,
-            Configurable.BOOLEAN_FORMAT_KEY,
-            Configurable.LOCALE_KEY,
-            Configurable.NUMBER_FORMAT_KEY,
-            Configurable.OBJECT_WRAPPER_KEY,
-            Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY
-        });
+        static final List KEYS = Arrays.asList(
+                Configurable.ARITHMETIC_ENGINE_KEY,
+                Configurable.BOOLEAN_FORMAT_KEY,
+                Configurable.LOCALE_KEY,
+                Configurable.NUMBER_FORMAT_KEY,
+                Configurable.OBJECT_WRAPPER_KEY,
+                Configurable.TEMPLATE_EXCEPTION_HANDLER_KEY);
 
         final Configurable configurable;
         
@@ -226,10 +224,7 @@ class RmiDebuggedEnvironmentImpl extends RmiDebugModelImpl implements DebuggedEn
     
     private static class DebugTemplateModel extends DebugConfigurableModel {
         private static final List KEYS = composeList(DebugConfigurableModel.KEYS, 
-            Arrays.asList(new String[] {
-                "configuration", 
-                "name",
-                }));
+            Arrays.asList("configuration", "name"));
     
         private final SimpleScalar name;
 
@@ -261,14 +256,13 @@ class RmiDebuggedEnvironmentImpl extends RmiDebugModelImpl implements DebuggedEn
 
     private static class DebugEnvironmentModel extends DebugConfigurableModel {
         private static final List KEYS = composeList(DebugConfigurableModel.KEYS, 
-            Arrays.asList(new String[] {
-                "currentNamespace",
-                "dataModel",
-                "globalNamespace",
-                "knownVariables",
-                "mainNamespace",
-                "template",
-                 }));
+            Arrays.asList(
+                    "currentNamespace",
+                    "dataModel",
+                    "globalNamespace",
+                    "knownVariables",
+                    "mainNamespace",
+                    "template"));
     
         private TemplateModel knownVariables = new DebugMapModel()
         {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
index 50886fa..a944d8b 100644
--- a/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
+++ b/src/main/java/org/apache/freemarker/core/debug/impl/RmiDebuggerService.java
@@ -118,7 +118,7 @@ extends
                 try {
                     denv.wait();
                 } catch (InterruptedException e) {
-                    ;// Intentionally ignored
+                    // Intentionally ignored
                 }
             }
             return denv.isStopped();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/AdapterTemplateModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/AdapterTemplateModel.java b/src/main/java/org/apache/freemarker/core/model/AdapterTemplateModel.java
index 3f43f5d..ad817b5 100644
--- a/src/main/java/org/apache/freemarker/core/model/AdapterTemplateModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/AdapterTemplateModel.java
@@ -45,5 +45,5 @@ public interface AdapterTemplateModel extends TemplateModel {
      * @return the underlying object, or its value accommodated for the hint
      * class.
      */
-    public Object getAdaptedObject(Class<?> hint);
+    Object getAdaptedObject(Class<?> hint);
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/SerializableTemplateBooleanModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/SerializableTemplateBooleanModel.java b/src/main/java/org/apache/freemarker/core/model/SerializableTemplateBooleanModel.java
index 51a4962..8a81eb3 100644
--- a/src/main/java/org/apache/freemarker/core/model/SerializableTemplateBooleanModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/SerializableTemplateBooleanModel.java
@@ -21,4 +21,4 @@ package org.apache.freemarker.core.model;
 
 import java.io.Serializable;
 
-interface SerializableTemplateBooleanModel extends TemplateBooleanModel, Serializable {};
\ No newline at end of file
+interface SerializableTemplateBooleanModel extends TemplateBooleanModel, Serializable {}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModel.java
index 7d5836c..b8e14f3 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateCollectionModel.java
@@ -43,6 +43,6 @@ public interface TemplateCollectionModel extends TemplateModel {
     /**
      * Retrieves a template model iterator that is used to iterate over the elements in this collection.
      */
-    public TemplateModelIterator iterator() throws TemplateModelException;
+    TemplateModelIterator iterator() throws TemplateModelException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateDateModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateDateModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateDateModel.java
index 5483e7e..351bb7b 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateDateModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateDateModel.java
@@ -38,38 +38,36 @@ public interface TemplateDateModel extends TemplateModel {
      * It is not known whether the date represents a date, a time, or a date-time value.
      * This often leads to exceptions in templates due to ambiguities it causes, so avoid it if possible.
      */
-    public static final int UNKNOWN = 0;
+    int UNKNOWN = 0;
 
     /**
      * The date model represents a time value (no date part).
      */
-    public static final int TIME = 1;
+    int TIME = 1;
 
     /**
      * The date model represents a date value (no time part).
      */
-    public static final int DATE = 2;
+    int DATE = 2;
 
     /**
      * The date model represents a date-time value (also known as timestamp).
      */
-    public static final int DATETIME = 3;
+    int DATETIME = 3;
     
-    public static final List TYPE_NAMES =
+    List TYPE_NAMES =
         Collections.unmodifiableList(
             Arrays.asList(
-                new String[] {
-                    "UNKNOWN", "TIME", "DATE", "DATETIME"
-                }));
+                    "UNKNOWN", "TIME", "DATE", "DATETIME"));
     /**
      * Returns the date value. The return value must not be {@code null}.
      */
-    public Date getAsDate() throws TemplateModelException;
+    Date getAsDate() throws TemplateModelException;
 
     /**
      * Returns the type of the date. It can be any of {@link #TIME}, 
      * {@link #DATE}, or {@link #DATETIME}.
      */
-    public int getDateType();
+    int getDateType();
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveBody.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveBody.java b/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveBody.java
index a901795..cd9edc3 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveBody.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveBody.java
@@ -41,5 +41,5 @@ public interface TemplateDirectiveBody {
      * might be after multiple renderings).
      * @param out the writer to write the output to.
      */
-    public void render(Writer out) throws TemplateException, IOException;
+    void render(Writer out) throws TemplateException, IOException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveModel.java
index 19e242b..80b6326 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateDirectiveModel.java
@@ -64,6 +64,6 @@ public interface TemplateDirectiveModel extends TemplateModel {
      *          output.
      * @throws IOException When writing the template output fails.
      */
-   public void execute(Environment env, Map params, TemplateModel[] loopVars, 
-            TemplateDirectiveBody body) throws TemplateException, IOException;
+    void execute(Environment env, Map params, TemplateModel[] loopVars,
+                 TemplateDirectiveBody body) throws TemplateException, IOException;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateMethodModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateMethodModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateMethodModel.java
index 77792d1..d624ede 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateMethodModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateMethodModel.java
@@ -56,5 +56,5 @@ public interface TemplateMethodModel extends TemplateModel {
      *     wrapped using the {@link Environment#getObjectWrapper() environment 
      *     object wrapper}.
      */
-    public Object exec(List arguments) throws TemplateModelException;
+    Object exec(List arguments) throws TemplateModelException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateMethodModelEx.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateMethodModelEx.java b/src/main/java/org/apache/freemarker/core/model/TemplateMethodModelEx.java
index 5a40bb9..fdf7ec0 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateMethodModelEx.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateMethodModelEx.java
@@ -49,6 +49,6 @@ public interface TemplateMethodModelEx extends TemplateMethodModel {
      *     object wrapper}.
      */
     @Override
-    public Object exec(List arguments) throws TemplateModelException;
+    Object exec(List arguments) throws TemplateModelException;
     
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateModelAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateModelAdapter.java b/src/main/java/org/apache/freemarker/core/model/TemplateModelAdapter.java
index 1ebd462..c112746 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateModelAdapter.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateModelAdapter.java
@@ -30,5 +30,5 @@ public interface TemplateModelAdapter {
     /**
      * @return the template model this object is wrapping.
      */
-    public TemplateModel getTemplateModel();
+    TemplateModel getTemplateModel();
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateNumberModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateNumberModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateNumberModel.java
index 97b870c..3d1695c 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateNumberModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateNumberModel.java
@@ -37,6 +37,6 @@ public interface TemplateNumberModel extends TemplateModel {
      *
      * @return the {@link Number} instance associated with this number model.
      */
-    public Number getAsNumber() throws TemplateModelException;
+    Number getAsNumber() throws TemplateModelException;
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java b/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
index e90be36..67acc24 100644
--- a/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/TemplateScalarModel.java
@@ -31,7 +31,7 @@ public interface TemplateScalarModel extends TemplateModel {
     /**
      * A constant value to use as the empty string.
      */
-    public TemplateModel EMPTY_STRING = new SimpleScalar("");
+    TemplateModel EMPTY_STRING = new SimpleScalar("");
 
     /**
      * Returns the string representation of this model. Don't return {@code null}, as that will cause exception.
@@ -40,6 +40,6 @@ public interface TemplateScalarModel extends TemplateModel {
      * Objects of this type should be immutable, that is, calling {@link #getAsString()} should always return the same
      * value as for the first time.
      */
-    public String getAsString() throws TemplateModelException;
+    String getAsString() throws TemplateModelException;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/TransformControl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/TransformControl.java b/src/main/java/org/apache/freemarker/core/model/TransformControl.java
index 5ae497f..2c04311 100644
--- a/src/main/java/org/apache/freemarker/core/model/TransformControl.java
+++ b/src/main/java/org/apache/freemarker/core/model/TransformControl.java
@@ -39,25 +39,25 @@ public interface TransformControl {
      * template engine to repeat transform body evaluation and feed
      * it again to the transform.
      */
-    public static final int REPEAT_EVALUATION = 0;
+    int REPEAT_EVALUATION = 0;
 
     /**
      * Constant returned from {@link #afterBody()} that tells the
      * template engine to end the transform and close the writer.
      */
-    public static final int END_EVALUATION = 1;
+    int END_EVALUATION = 1;
  
     /**
      * Constant returned from {@link #onStart()} that tells the
      * template engine to skip evaluation of the body.
      */
-    public static final int SKIP_BODY = 0;
+    int SKIP_BODY = 0;
     
     /**
      * Constant returned from {@link #onStart()} that tells the
      * template engine to evaluate the body.
      */
-    public static final int EVALUATE_BODY = 1;
+    int EVALUATE_BODY = 1;
 
     /**
      * Called before the body is evaluated for the first time.
@@ -69,7 +69,7 @@ public interface TransformControl {
      * and feed it to the writer</li>
      * </ul>
      */
-    public int onStart() throws TemplateModelException, IOException;
+    int onStart() throws TemplateModelException, IOException;
     
     /**
      * Called after the body has been evaluated.
@@ -80,7 +80,7 @@ public interface TransformControl {
      * transform body and feed it again to the writer.</li>
      * </ul>
      */
-    public int afterBody() throws TemplateModelException, IOException;
+    int afterBody() throws TemplateModelException, IOException;
     
     /**
      * Called if any exception occurs during the transform between the
@@ -97,5 +97,5 @@ public interface TransformControl {
      * other checked exception will cause the engine to rethrow it as
      * a {@link java.lang.reflect.UndeclaredThrowableException}.
      */
-    public void onError(Throwable t) throws Throwable;
+    void onError(Throwable t) throws Throwable;
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/WrapperTemplateModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/WrapperTemplateModel.java b/src/main/java/org/apache/freemarker/core/model/WrapperTemplateModel.java
index 2f3c838..a818dc4 100644
--- a/src/main/java/org/apache/freemarker/core/model/WrapperTemplateModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/WrapperTemplateModel.java
@@ -29,5 +29,5 @@ public interface WrapperTemplateModel extends TemplateModel {
     /**
      * Retrieves the original object wrapped by this model.
      */
-    public Object getWrappedObject();
+    Object getWrappedObject();
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/SimpleHash.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/SimpleHash.java b/src/main/java/org/apache/freemarker/core/model/impl/SimpleHash.java
index b4b59e3..40c33f7 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/SimpleHash.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/SimpleHash.java
@@ -146,6 +146,7 @@ public class SimpleHash extends WrappingTemplateModel implements TemplateHashMod
             try {
                 Thread.sleep(5);
             } catch (InterruptedException ie) {
+                // Ignored
             }
             synchronized (map) {
                 mapCopy = copyMap(map);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
index eded99c..15866c6 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapper.java
@@ -881,7 +881,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
     }
 
     /**
-     * See {@try #tryUnwrap(TemplateModel, Class, int, boolean)}.
+     * See {@link #tryUnwrap(TemplateModel, Class, int, boolean)}.
      */
     private Object tryUnwrapTo(final TemplateModel model, Class<?> targetClass, final int typeFlags,
             final Map<Object, Object> recursionStops) 
@@ -1554,7 +1554,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
         if (ENUMS_MODEL_CTOR != null) {
             try {
                 return (ClassBasedModelFactory) ENUMS_MODEL_CTOR.newInstance(
-                        new Object[] { wrapper });
+                        wrapper);
             } catch (Exception e) {
                 throw new UndeclaredThrowableException(e);
             }
@@ -1570,7 +1570,7 @@ public class BeansWrapper implements RichObjectWrapper, WriteProtectable {
             // If they are, return the appropriate constructor for enum models
             return Class.forName(
                 "org.apache.freemarker.core.model.impl.beans._EnumModels").getDeclaredConstructor(
-                        new Class[] { BeansWrapper.class });
+                    BeansWrapper.class);
         } catch (Exception e) {
             // Otherwise, return null
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
index 327cbc5..b2b5e91 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperConfiguration.java
@@ -122,9 +122,7 @@ public abstract class BeansWrapperConfiguration implements Cloneable {
         if (outerIdentity != other.outerIdentity) return false;
         if (strict != other.strict) return false;
         if (useModelCache != other.useModelCache) return false;
-        if (!classIntrospectorFactory.equals(other.classIntrospectorFactory)) return false;
-        
-        return true;
+        return classIntrospectorFactory.equals(other.classIntrospectorFactory);
     }
     
     protected Object clone(boolean deepCloneKey) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
index 8716a3b..c6f6cb6 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/ClassIntrospectorBuilder.java
@@ -90,9 +90,7 @@ final class ClassIntrospectorBuilder implements Cloneable {
         if (exposeFields != other.exposeFields) return false;
         if (exposureLevel != other.exposureLevel) return false;
         if (methodAppearanceFineTuner != other.methodAppearanceFineTuner) return false;
-        if (methodSorter != other.methodSorter) return false;
-        
-        return true;
+        return methodSorter == other.methodSorter;
     }
     
     public int getExposureLevel() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/EmptyCallableMemberDescriptor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/EmptyCallableMemberDescriptor.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/EmptyCallableMemberDescriptor.java
index d7558f9..d0e6b8e 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/EmptyCallableMemberDescriptor.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/EmptyCallableMemberDescriptor.java
@@ -30,6 +30,6 @@ final class EmptyCallableMemberDescriptor extends MaybeEmptyCallableMemberDescri
     static final EmptyCallableMemberDescriptor NO_SUCH_METHOD = new EmptyCallableMemberDescriptor();
     static final EmptyCallableMemberDescriptor AMBIGUOUS_METHOD = new EmptyCallableMemberDescriptor();
     
-    private EmptyCallableMemberDescriptor() { };
-    
+    private EmptyCallableMemberDescriptor() { }
+
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/ModelCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/ModelCache.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/ModelCache.java
index 2dd422a..4c5e415 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/ModelCache.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/ModelCache.java
@@ -92,7 +92,7 @@ public abstract class ModelCache {
         }
     }
 
-    private final TemplateModel lookup(Object object) {
+    private TemplateModel lookup(Object object) {
         ModelReference ref = null;
         // NOTE: we're doing minimal synchronizations -- which can lead to
         // duplicate wrapper creation. However, this has no harmful side-effects and
@@ -107,7 +107,7 @@ public abstract class ModelCache {
         return null;
     }
 
-    private final void register(TemplateModel model, Object object) {
+    private void register(TemplateModel model, Object object) {
         synchronized (modelCache) {
             // Remove cleared references
             for (; ; ) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedNumberUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedNumberUtil.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedNumberUtil.java
index 1e9c0bc..4d4ae97 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedNumberUtil.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/OverloadedNumberUtil.java
@@ -312,14 +312,14 @@ class OverloadedNumberUtil {
         }
     }
 
-    static interface ByteSource { Byte byteValue(); }
-    static interface ShortSource { Short shortValue(); }
-    static interface IntegerSource { Integer integerValue(); }
-    static interface LongSource { Long longValue(); }
-    static interface FloatSource { Float floatValue(); }
-    static interface DoubleSource { Double doubleValue(); }
-    static interface BigIntegerSource { BigInteger bigIntegerValue(); }
-    static interface BigDecimalSource { BigDecimal bigDecimalValue(); }
+    interface ByteSource { Byte byteValue(); }
+    interface ShortSource { Short shortValue(); }
+    interface IntegerSource { Integer integerValue(); }
+    interface LongSource { Long longValue(); }
+    interface FloatSource { Float floatValue(); }
+    interface DoubleSource { Double doubleValue(); }
+    interface BigIntegerSource { BigInteger bigIntegerValue(); }
+    interface BigDecimalSource { BigDecimal bigDecimalValue(); }
     
     /**
      * Superclass of "Or"-ed numerical types. With an example, a {@code int} 1 has the fallback type {@code byte}, as

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/SimpleMethod.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/SimpleMethod.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/SimpleMethod.java
index 940c4bc..df16ae1 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/SimpleMethod.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/SimpleMethod.java
@@ -73,8 +73,7 @@ class SimpleMethod {
                     Integer.valueOf(arguments.size()), " was given.");
         }
          
-        Object[] args = unwrapArguments(arguments, argTypes, isVarArg, wrapper);
-        return args;
+        return unwrapArguments(arguments, argTypes, isVarArg, wrapper);
     }
 
     private Object[] unwrapArguments(List args, Class[] argTypes, boolean isVarargs,

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/beans/UnsafeMethods.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/beans/UnsafeMethods.java b/src/main/java/org/apache/freemarker/core/model/impl/beans/UnsafeMethods.java
index 78f5093..93b7f3c 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/beans/UnsafeMethods.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/beans/UnsafeMethods.java
@@ -45,7 +45,7 @@ class UnsafeMethods {
         return UNSAFE_METHODS.contains(method);        
     }
     
-    private static final Set createUnsafeMethodsSet() {
+    private static Set createUnsafeMethodsSet() {
         Properties props = new Properties();
         InputStream in = BeansWrapper.class.getResourceAsStream(UNSAFE_METHODS_PROPERTIES);
         if (in == null) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/dom/AtAtKey.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/AtAtKey.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/AtAtKey.java
index e8ab99e..a21ebcc 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/AtAtKey.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/AtAtKey.java
@@ -42,7 +42,7 @@ enum AtAtKey {
         return key;
     }
 
-    private AtAtKey(String key) {
+    AtAtKey(String key) {
         this.key = key;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/dom/DocumentTypeModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/DocumentTypeModel.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/DocumentTypeModel.java
index d4ad5f1..768b1d6 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/DocumentTypeModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/DocumentTypeModel.java
@@ -46,7 +46,7 @@ class DocumentTypeModel extends NodeModel {
     
     @Override
     public String getNodeName() {
-        return "@document_type$" + ((DocumentType) node).getNodeName();
+        return "@document_type$" + node.getNodeName();
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
index 08a0768..76d818f 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/JaxenXPathSupport.java
@@ -204,8 +204,7 @@ class JaxenXPathSupport implements XPathSupport {
         int lastSlash = templatePath.lastIndexOf('/');
         templatePath = lastSlash == -1 ? "" : templatePath.substring(0, lastSlash + 1);
         systemId = env.toFullTemplateName(templatePath, systemId);
-        Template raw = env.getConfiguration().getTemplate(systemId, env.getLocale(), encoding, false);
-        return raw;
+        return env.getConfiguration().getTemplate(systemId, env.getLocale(), encoding, false);
     }
 
     private static InputSource createInputSource(String publicId, Template raw) throws IOException, SAXException {
@@ -235,5 +234,5 @@ class JaxenXPathSupport implements XPathSupport {
         int getCallCount() {
             return callCount;
         }
-    };
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeModel.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeModel.java
index 293227c..ca04d53 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeModel.java
@@ -460,17 +460,17 @@ implements TemplateNodeModelEx, TemplateHashModel, TemplateSequenceModel,
             try {
                 useXalanXPathSupport();
             } catch (Exception e) {
-                ; // ignore
+                // ignore
             }
             if (xpathSupportClass == null) try {
             	useSunInternalXPathSupport();
             } catch (Exception e) {
-            	; // ignore
+                // ignore
             }
             if (xpathSupportClass == null) try {
                 useJaxenXPathSupport();
             } catch (Exception e) {
-                ; // ignore
+                // ignore
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/templateresolver/CacheStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/CacheStorage.java b/src/main/java/org/apache/freemarker/core/templateresolver/CacheStorage.java
index e9e1d4c..134d226 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/CacheStorage.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/CacheStorage.java
@@ -28,8 +28,8 @@ package org.apache.freemarker.core.templateresolver;
  * @see org.apache.freemarker.core.Configuration#setCacheStorage(CacheStorage)
  */
 public interface CacheStorage {
-    public Object get(Object key);
-    public void put(Object key, Object value);
-    public void remove(Object key);
-    public void clear();
+    Object get(Object key);
+    void put(Object key, Object value);
+    void remove(Object key);
+    void clear();
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactory.java b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactory.java
index abd15c8..2bc6550 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactory.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateConfigurationFactory.java
@@ -65,7 +65,6 @@ public abstract class TemplateConfigurationFactory {
                 throw new IllegalStateException(
                         "The TemplateConfigurationFactory is already bound to another Configuration");
             }
-            return;
         } else {
             this.cfg = cfg;
             setConfigurationOfChildren(cfg);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoaderSession.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoaderSession.java b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoaderSession.java
index 262dcce..6c85740 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoaderSession.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoaderSession.java
@@ -65,11 +65,11 @@ public interface TemplateLoaderSession {
      * <p>The caller of {@link TemplateLoader#createSession()} has to guarantee that {@link #close()} will be called on
      * the created session.
      */
-    public void close() throws IOException;
+    void close() throws IOException;
     
     /**
      * Tells if this session is closed.
      */
-    public boolean isClosed();
+    boolean isClosed();
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
index 823a046..6c11b6a 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateResolver.java
@@ -117,7 +117,7 @@ public abstract class TemplateResolver {
      *        operation.
      */
     public abstract void removeTemplateFromCache(String name, Locale locale, String encoding, boolean parse)
-            throws IOException, UnsupportedOperationException;;
+            throws IOException, UnsupportedOperationException;
 
     /**
      * Converts a name to a template root directory based name, so that it can be used to find a template without

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
index 4678988..bf574e2 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/DefaultTemplateResolver.java
@@ -473,9 +473,9 @@ public class DefaultTemplateResolver extends TemplateResolver {
     
     private static final Method INIT_CAUSE = getInitCauseMethod();
     
-    private static final Method getInitCauseMethod() {
+    private static Method getInitCauseMethod() {
         try {
-            return Throwable.class.getMethod("initCause", new Class[] { Throwable.class });
+            return Throwable.class.getMethod("initCause", Throwable.class);
         } catch (NoSuchMethodException e) {
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/util/_ClassUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/_ClassUtil.java b/src/main/java/org/apache/freemarker/core/util/_ClassUtil.java
index 1c87c45..0401ce0 100644
--- a/src/main/java/org/apache/freemarker/core/util/_ClassUtil.java
+++ b/src/main/java/org/apache/freemarker/core/util/_ClassUtil.java
@@ -46,9 +46,9 @@ public class _ClassUtil {
                 return Class.forName(className, true, ctcl);
             }
         } catch (ClassNotFoundException e) {
-            ;// Intentionally ignored
+            // Intentionally ignored
         } catch (SecurityException e) {
-            ;// Intentionally ignored
+            // Intentionally ignored
         }
         // Fall back to the defining class loader of the FreeMarker classes 
         return Class.forName(className);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/src/main/java/org/apache/freemarker/core/util/_NumberUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/_NumberUtil.java b/src/main/java/org/apache/freemarker/core/util/_NumberUtil.java
index 82f7c48..0e9825a 100644
--- a/src/main/java/org/apache/freemarker/core/util/_NumberUtil.java
+++ b/src/main/java/org/apache/freemarker/core/util/_NumberUtil.java
@@ -64,31 +64,31 @@ public class _NumberUtil {
      */
     public static int getSignum(Number num) throws ArithmeticException {
         if (num instanceof Integer) {
-            int n = ((Integer) num).intValue();
+            int n = num.intValue();
             return n > 0 ? 1 : (n == 0 ? 0 : -1);
         } else if (num instanceof BigDecimal) {
             BigDecimal n = (BigDecimal) num;
             return n.signum();
         } else if (num instanceof Double) {
-            double n = ((Double) num).doubleValue();
+            double n = num.doubleValue();
             if (n > 0) return 1;
             else if (n == 0) return 0;
             else if (n < 0) return -1;
             else throw new ArithmeticException("The signum of " + n + " is not defined.");  // NaN
         } else if (num instanceof Float) {
-            float n = ((Float) num).floatValue();
+            float n = num.floatValue();
             if (n > 0) return 1;
             else if (n == 0) return 0;
             else if (n < 0) return -1;
             else throw new ArithmeticException("The signum of " + n + " is not defined.");  // NaN
         } else if (num instanceof Long) {
-            long n = ((Long) num).longValue();
+            long n = num.longValue();
             return n > 0 ? 1 : (n == 0 ? 0 : -1);
         } else if (num instanceof Short) {
-            short n = ((Short) num).shortValue();
+            short n = num.shortValue();
             return n > 0 ? 1 : (n == 0 ? 0 : -1);
         } else if (num instanceof Byte) {
-            byte n = ((Byte) num).byteValue();
+            byte n = num.byteValue();
             return n > 0 ? 1 : (n == 0 ? 0 : -1);
         } else if (num instanceof BigInteger) {
             BigInteger n = (BigInteger) num;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/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 d677006..9674727 100644
--- a/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
+++ b/src/main/java/org/apache/freemarker/core/util/_StringUtil.java
@@ -175,8 +175,7 @@ public class _StringUtil {
     private static boolean maybeCDataEndGT(String s, int i) {
         if (i == 0) return true;
         if (s.charAt(i - 1) != ']') return false;
-        if (i == 1 || s.charAt(i - 2) == ']') return true;
-        return false;
+        return i == 1 || s.charAt(i - 2) == ']';
     }
 
     private static void XMLOrHTMLEnc(String s, char[] apos, Writer out) throws IOException {
@@ -648,7 +647,7 @@ public class _StringUtil {
     }
     
     /**
-     * Same as {@link #jQuoteNoXSS(String)} but also escapes <code>'&lt;'</code>
+     * Same as {@link #jQuote(String)} but also escapes <code>'&lt;'</code>
      * as <code>\</code><code>u003C</code>. This is used for log messages to prevent XSS
      * on poorly written Web-based log viewers. 
      */
@@ -904,11 +903,10 @@ public class _StringUtil {
                             sb.append(toHexDigit(c & 0xF));
                         } else {
                             sb.append('u');
-                            int cp = c;
-                            sb.append(toHexDigit((cp >> 12) & 0xF));
-                            sb.append(toHexDigit((cp >> 8) & 0xF));
-                            sb.append(toHexDigit((cp >> 4) & 0xF));
-                            sb.append(toHexDigit(cp & 0xF));
+                            sb.append(toHexDigit((c >> 12) & 0xF));
+                            sb.append(toHexDigit((c >> 8) & 0xF));
+                            sb.append(toHexDigit((c >> 4) & 0xF));
+                            sb.append(toHexDigit(c & 0xF));
                         }
                     } else {  // escapeType == ESC_BACKSLASH
                         sb.append(c);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/983ad9bd/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 5bfcd24..e510aad 100644
--- a/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
+++ b/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
@@ -684,9 +684,9 @@ public class FreemarkerServlet extends HttpServlet {
                     overrideResponseLocale = initParamValueToEnum(value, OverrideResponseLocale.values());
                 } else if (name.equals(INIT_PARAM_EXCEPTION_ON_MISSING_TEMPLATE)) {
                     exceptionOnMissingTemplate = _StringUtil.getYesNo(value);
-                } else if (name.equals(INIT_PARAM_META_INF_TLD_LOCATIONS)) {;
+                } else if (name.equals(INIT_PARAM_META_INF_TLD_LOCATIONS)) {
                     metaInfTldSources = parseAsMetaInfTldLocations(value);
-                } else if (name.equals(INIT_PARAM_CLASSPATH_TLDS)) {;
+                } else if (name.equals(INIT_PARAM_CLASSPATH_TLDS)) {
                     List newClasspathTlds = new ArrayList();
                     if (classpathTlds != null) {
                         newClasspathTlds.addAll(classpathTlds);



Mime
View raw message