freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/2] incubator-freemarker git commit: Removed unnecessary "this."-s
Date Fri, 17 Feb 2017 17:45:09 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/3 18843c030 -> ee8e20967


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/model/impl/dom/ElementModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/ElementModel.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/ElementModel.java
index 8874cba..12e8c2f 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/ElementModel.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/ElementModel.java
@@ -86,14 +86,14 @@ class ElementModel extends NodeModel implements TemplateScalarModel {
                     return new SimpleScalar(buf.toString().trim());
                 } else if (key.equals(AtAtKey.PREVIOUS_SIBLING_ELEMENT.getKey())) {
                     Node previousSibling = node.getPreviousSibling();
-                    while (previousSibling != null && !this.isSignificantNode(previousSibling))
{
+                    while (previousSibling != null && !isSignificantNode(previousSibling))
{
                         previousSibling = previousSibling.getPreviousSibling();
                     }
                     return previousSibling != null && previousSibling.getNodeType()
== Node.ELEMENT_NODE
                             ? wrap(previousSibling) : new NodeListModel(Collections.emptyList(),
null);  
                 } else if (key.equals(AtAtKey.NEXT_SIBLING_ELEMENT.getKey())) {
                     Node nextSibling = node.getNextSibling();
-                    while (nextSibling != null && !this.isSignificantNode(nextSibling))
{
+                    while (nextSibling != null && !isSignificantNode(nextSibling))
{
                         nextSibling = nextSibling.getNextSibling();
                     }
                     return nextSibling != null && nextSibling.getNodeType() == Node.ELEMENT_NODE

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/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 2aca51d..a1679d5 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
@@ -446,8 +446,8 @@ implements TemplateNodeModelEx, TemplateHashModel, TemplateSequenceModel,
     @Override
     public boolean equals(Object other) {
         if (other == null) return false;
-        return other.getClass() == this.getClass() 
-                && ((NodeModel) other).node.equals(this.node);
+        return other.getClass() == getClass()
+                && ((NodeModel) other).node.equals(node);
     }
     
     static public NodeModel wrap(Node node) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeOutputter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeOutputter.java b/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeOutputter.java
index feed784..737e13c 100644
--- a/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeOutputter.java
+++ b/src/main/java/org/apache/freemarker/core/model/impl/dom/NodeOutputter.java
@@ -57,9 +57,9 @@ class NodeOutputter {
     
     private void setContext(Element contextNode) {
         this.contextNode = contextNode;
-        this.env = Environment.getCurrentEnvironment();
-        this.defaultNS = env.getDefaultNS();
-        this.hasDefaultNS = defaultNS != null && defaultNS.length() > 0;
+        env = Environment.getCurrentEnvironment();
+        defaultNS = env.getDefaultNS();
+        hasDefaultNS = defaultNS != null && defaultNS.length() > 0;
         namespacesToPrefixLookup.put(null, "");
         namespacesToPrefixLookup.put("", "");
         buildPrefixLookup(contextNode);
@@ -121,7 +121,7 @@ class NodeOutputter {
             buf.append(nsURI);
             buf.append("\"");
         }
-        this.namespaceDecl = buf.toString();
+        namespaceDecl = buf.toString();
     }
     
     private void outputQualifiedName(Node n, StringBuilder buf) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/ConditionalTemplateConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/ConditionalTemplateConfigurationFactory.java
b/src/main/java/org/apache/freemarker/core/templateresolver/ConditionalTemplateConfigurationFactory.java
index b835243..6069d2e 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/ConditionalTemplateConfigurationFactory.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/ConditionalTemplateConfigurationFactory.java
@@ -38,7 +38,7 @@ public class ConditionalTemplateConfigurationFactory extends TemplateConfigurati
     public ConditionalTemplateConfigurationFactory(
             TemplateSourceMatcher matcher, TemplateConfigurationFactory templateConfigurationFactory)
{
         this.matcher = matcher;
-        this.templateConfiguration = null;
+        templateConfiguration = null;
         this.templateConfigurationFactory = templateConfigurationFactory;
     }
     
@@ -46,7 +46,7 @@ public class ConditionalTemplateConfigurationFactory extends TemplateConfigurati
             TemplateSourceMatcher matcher, TemplateConfiguration templateConfiguration) {
         this.matcher = matcher;
         this.templateConfiguration = templateConfiguration;
-        this.templateConfigurationFactory = null;
+        templateConfigurationFactory = null;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/GetTemplateResult.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/GetTemplateResult.java
b/src/main/java/org/apache/freemarker/core/templateresolver/GetTemplateResult.java
index 845c2a2..d86d25d 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/GetTemplateResult.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/GetTemplateResult.java
@@ -37,23 +37,23 @@ public final class GetTemplateResult {
     
     public GetTemplateResult(Template template) {
         this.template = template;
-        this.missingTemplateNormalizedName = null;
-        this.missingTemplateReason = null;
-        this.missingTemplateCauseException = null;
+        missingTemplateNormalizedName = null;
+        missingTemplateReason = null;
+        missingTemplateCauseException = null;
     }
     
     public GetTemplateResult(String normalizedName, Exception missingTemplateCauseException)
{
-        this.template = null;
-        this.missingTemplateNormalizedName = normalizedName;
-        this.missingTemplateReason = null;
+        template = null;
+        missingTemplateNormalizedName = normalizedName;
+        missingTemplateReason = null;
         this.missingTemplateCauseException = missingTemplateCauseException;
     }
     
     public GetTemplateResult(String normalizedName, String missingTemplateReason) {
-        this.template = null;
-        this.missingTemplateNormalizedName = normalizedName;
+        template = null;
+        missingTemplateNormalizedName = normalizedName;
         this.missingTemplateReason = missingTemplateReason;
-        this.missingTemplateCauseException = null;
+        missingTemplateCauseException = null;
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoadingResult.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoadingResult.java
b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoadingResult.java
index b34b718..7590959 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoadingResult.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/TemplateLoadingResult.java
@@ -69,11 +69,11 @@ public final class TemplateLoadingResult {
             TemplateConfiguration templateConfiguration) {
         _NullArgumentException.check("templateSource", source);
         _NullArgumentException.check("reader", reader);
-        this.status = TemplateLoadingResultStatus.OPENED;
+        status = TemplateLoadingResultStatus.OPENED;
         this.source = source;
         this.version = version;
         this.reader = reader;
-        this.inputStream = null;
+        inputStream = null;
         this.templateConfiguration = templateConfiguration; 
     }
 
@@ -101,10 +101,10 @@ public final class TemplateLoadingResult {
             TemplateConfiguration templateConfiguration) {
         _NullArgumentException.check("templateSource", source);
         _NullArgumentException.check("inputStream", inputStream);
-        this.status = TemplateLoadingResultStatus.OPENED;
+        status = TemplateLoadingResultStatus.OPENED;
         this.source = source;
         this.version = version;
-        this.reader = null;
+        reader = null;
         this.inputStream = inputStream;
         this.templateConfiguration = templateConfiguration; 
     }
@@ -114,11 +114,11 @@ public final class TemplateLoadingResult {
      */
     private TemplateLoadingResult(TemplateLoadingResultStatus status) {
         this.status = status;
-        this.source = null;
-        this.version = null;
-        this.reader = null;
-        this.inputStream = null;
-        this.templateConfiguration = null;
+        source = null;
+        version = null;
+        reader = null;
+        inputStream = null;
+        templateConfiguration = null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/impl/ClassTemplateLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/ClassTemplateLoader.java
b/src/main/java/org/apache/freemarker/core/templateresolver/impl/ClassTemplateLoader.java
index b84b600..a64e6a4 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/ClassTemplateLoader.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/ClassTemplateLoader.java
@@ -88,7 +88,7 @@ public class ClassTemplateLoader extends URLTemplateLoader {
         _NullArgumentException.check("basePackagePath", basePackagePath);
 
         // Either set a non-null resourceLoaderClass or a non-null classLoader, not both:
-        this.resourceLoaderClass = classLoader == null ? (resourceLoaderClass == null ? this.getClass()
+        this.resourceLoaderClass = classLoader == null ? (resourceLoaderClass == null ? getClass()
                 : resourceLoaderClass) : null;
         if (this.resourceLoaderClass == null && classLoader == null) {
             throw new _NullArgumentException("classLoader");

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/impl/FileTemplateLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/FileTemplateLoader.java
b/src/main/java/org/apache/freemarker/core/templateresolver/impl/FileTemplateLoader.java
index 360dd60..93f99f0 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/FileTemplateLoader.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/FileTemplateLoader.java
@@ -138,7 +138,7 @@ public class FileTemplateLoader implements TemplateLoader {
                 }
             });
             this.baseDir = (File) retval[0];
-            this.canonicalBasePath = (String) retval[1];
+            canonicalBasePath = (String) retval[1];
             
             setEmulateCaseSensitiveFileSystem(getEmulateCaseSensitiveFileSystemDefault());
         } catch (PrivilegedActionException e) {
@@ -275,9 +275,9 @@ public class FileTemplateLoader implements TemplateLoader {
      * 
      * @since 2.3.23
      */
-    public void setEmulateCaseSensitiveFileSystem(boolean nameCaseChecked) {
+    public void setEmulateCaseSensitiveFileSystem(boolean emulateCaseSensitiveFileSystem)
{
         // Ensure that the cache exists exactly when needed:
-        if (nameCaseChecked) {
+        if (emulateCaseSensitiveFileSystem) {
             if (correctCasePaths == null) {
                 correctCasePaths = new MruCacheStorage(CASE_CHECH_CACHE_HARD_SIZE, CASE_CHECK_CACHE__SOFT_SIZE);
             }
@@ -285,7 +285,7 @@ public class FileTemplateLoader implements TemplateLoader {
             correctCasePaths = null;
         }
         
-        this.emulateCaseSensitiveFileSystem = nameCaseChecked;
+        this.emulateCaseSensitiveFileSystem = emulateCaseSensitiveFileSystem;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/impl/MruCacheStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/MruCacheStorage.java
b/src/main/java/org/apache/freemarker/core/templateresolver/impl/MruCacheStorage.java
index 367714f..59be66f 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/MruCacheStorage.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/MruCacheStorage.java
@@ -318,7 +318,7 @@ public class MruCacheStorage implements CacheStorageWithGetSize {
         
         MruReference(MruEntry entry, ReferenceQueue queue) {
             super(entry.getValue(), queue);
-            this.key = entry.getKey();
+            key = entry.getKey();
         }
         
         Object getKey() {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/templateresolver/impl/SoftCacheStorage.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/templateresolver/impl/SoftCacheStorage.java
b/src/main/java/org/apache/freemarker/core/templateresolver/impl/SoftCacheStorage.java
index 0973989..1c0bd81 100644
--- a/src/main/java/org/apache/freemarker/core/templateresolver/impl/SoftCacheStorage.java
+++ b/src/main/java/org/apache/freemarker/core/templateresolver/impl/SoftCacheStorage.java
@@ -65,7 +65,7 @@ public class SoftCacheStorage implements ConcurrentCacheStorage, CacheStorageWit
     
     public SoftCacheStorage(Map backingMap) {
         map = backingMap;
-        this.concurrent = map instanceof ConcurrentMap;
+        concurrent = map instanceof ConcurrentMap;
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/util/_ArrayEnumeration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/_ArrayEnumeration.java b/src/main/java/org/apache/freemarker/core/util/_ArrayEnumeration.java
index d16afac..1258397 100644
--- a/src/main/java/org/apache/freemarker/core/util/_ArrayEnumeration.java
+++ b/src/main/java/org/apache/freemarker/core/util/_ArrayEnumeration.java
@@ -32,7 +32,7 @@ public class _ArrayEnumeration implements Enumeration {
     public _ArrayEnumeration(Object[] array, int size) {
         this.array = array;
         this.size = size;
-        this.nextIndex = 0;
+        nextIndex = 0;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/core/util/_ArrayIterator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/core/util/_ArrayIterator.java b/src/main/java/org/apache/freemarker/core/util/_ArrayIterator.java
index 4bcd654..f077d42 100644
--- a/src/main/java/org/apache/freemarker/core/util/_ArrayIterator.java
+++ b/src/main/java/org/apache/freemarker/core/util/_ArrayIterator.java
@@ -30,7 +30,7 @@ public class _ArrayIterator implements Iterator {
 
     public _ArrayIterator(Object[] array) {
         this.array = array;
-        this.nextIndex = 0;
+        nextIndex = 0;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/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 b22d5ec..d5f87b6 100644
--- a/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
+++ b/src/main/java/org/apache/freemarker/servlet/FreemarkerServlet.java
@@ -552,7 +552,7 @@ public class FreemarkerServlet extends HttpServlet {
         } catch (Exception e) {
             // At least Jetty doesn't log the ServletException itself, only its cause exception.
Thus we add some
             // message here that (re)states the obvious.
-            throw new ServletException("Error while initializing " + this.getClass().getName()
+            throw new ServletException("Error while initializing " + getClass().getName()
                     + " servlet; see cause exception.", e);
         }
     }
@@ -978,7 +978,7 @@ public class FreemarkerServlet extends HttpServlet {
             }
             if (logWarn) {
                 LOG.warn(
-                        this.getClass().getName()
+                        getClass().getName()
                         + ".wrapper != config.getObjectWrapper(); possibly the result of
incorrect extension of "
                         + FreemarkerServlet.class.getName() + ".");
             }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/servlet/HttpSessionHashModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/HttpSessionHashModel.java b/src/main/java/org/apache/freemarker/servlet/HttpSessionHashModel.java
index 405f710..5bfa165 100644
--- a/src/main/java/org/apache/freemarker/servlet/HttpSessionHashModel.java
+++ b/src/main/java/org/apache/freemarker/servlet/HttpSessionHashModel.java
@@ -53,9 +53,9 @@ public final class HttpSessionHashModel implements TemplateHashModel, Serializab
         this.session = session;
         this.wrapper = wrapper;
 
-        this.servlet = null;
-        this.request = null;
-        this.response = null;
+        servlet = null;
+        request = null;
+        response = null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java b/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
index 29b12d8..76023cb 100644
--- a/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
+++ b/src/main/java/org/apache/freemarker/servlet/ServletContextHashModel.java
@@ -38,7 +38,7 @@ public final class ServletContextHashModel implements TemplateHashModel
{
     public ServletContextHashModel(
         GenericServlet servlet, ObjectWrapper wrapper) {
         this.servlet = servlet;
-        this.servletctx = servlet.getServletContext();
+        servletctx = servlet.getServletContext();
         this.wrapper = wrapper;
     }
     
@@ -49,7 +49,7 @@ public final class ServletContextHashModel implements TemplateHashModel
{
     @Deprecated
     public ServletContextHashModel(
         ServletContext servletctx, ObjectWrapper wrapper) {
-        this.servlet = null;
+        servlet = null;
         this.servletctx = servletctx;
         this.wrapper = wrapper;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/servlet/WebAppTemplateLoader.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/WebAppTemplateLoader.java b/src/main/java/org/apache/freemarker/servlet/WebAppTemplateLoader.java
index b3caaa7..d1ceddc 100644
--- a/src/main/java/org/apache/freemarker/servlet/WebAppTemplateLoader.java
+++ b/src/main/java/org/apache/freemarker/servlet/WebAppTemplateLoader.java
@@ -160,8 +160,8 @@ public class WebAppTemplateLoader implements TemplateLoader {
      * 
      * @since 2.3.23
      */
-    public void setAttemptFileAccess(boolean attemptLoadingFromFile) {
-        this.attemptFileAccess = attemptLoadingFromFile;
+    public void setAttemptFileAccess(boolean attemptFileAccess) {
+        this.attemptFileAccess = attemptFileAccess;
     }
 
     @Override
@@ -250,11 +250,11 @@ public class WebAppTemplateLoader implements TemplateLoader {
         
         WebAppTemplateLoadingSource(File file) {
             this.file = file;
-            this.url = null;
+            url = null;
         }
 
         WebAppTemplateLoadingSource(URL url) {
-            this.file = null;
+            file = null;
             this.url = url;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java b/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
index 8b413f7..cb15e50 100644
--- a/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
+++ b/src/main/java/org/apache/freemarker/servlet/jsp/FreeMarkerPageContext.java
@@ -92,7 +92,7 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
                     FreemarkerServlet.KEY_APPLICATION);
         }
         if (appModel instanceof ServletContextHashModel) {
-            this.servlet = ((ServletContextHashModel) appModel).getServlet();
+            servlet = ((ServletContextHashModel) appModel).getServlet();
         } else {
             throw new  TemplateModelException("Could not find an instance of " + 
                     ServletContextHashModel.class.getName() + 
@@ -113,8 +113,8 @@ abstract class FreeMarkerPageContext extends PageContext implements TemplateMode
             session = request.getSession(false);
             response = reqHash.getResponse();
             wrapper = reqHash.getObjectWrapper();
-            unwrapper = this.wrapper instanceof ObjectWrapperAndUnwrapper
-                    ? (ObjectWrapperAndUnwrapper) this.wrapper : null;
+            unwrapper = wrapper instanceof ObjectWrapperAndUnwrapper
+                    ? (ObjectWrapperAndUnwrapper) wrapper : null;
         } else {
             throw new  TemplateModelException("Could not find an instance of " + 
                     HttpRequestHashModel.class.getName() + 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java b/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
index c8c7e2a..c171415 100644
--- a/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
+++ b/src/main/java/org/apache/freemarker/servlet/jsp/TaglibFactory.java
@@ -150,11 +150,11 @@ public class TaglibFactory implements TemplateHashModel {
      * <p>This object is only thread-safe after you have stopped calling its setter
methods (and it was properly
      * published to the other threads; see JSR 133 (Java Memory Model)).
      * 
-     * @param ctx
+     * @param servletContext
      *            The servlet context whose JSP tag libraries this factory will load.
      */
-    public TaglibFactory(ServletContext ctx) {
-        this.servletContext = ctx;
+    public TaglibFactory(ServletContext servletContext) {
+        this.servletContext = servletContext;
     }
 
     /**
@@ -1955,7 +1955,7 @@ public class TaglibFactory implements TemplateHashModel {
         @Override
         public Throwable getCause() {
             Throwable superCause = super.getCause();
-            return superCause == null ? this.cause : superCause;
+            return superCause == null ? cause : superCause;
         }
     
     }
@@ -1967,7 +1967,7 @@ public class TaglibFactory implements TemplateHashModel {
 
         public URLWithExternalForm(URL url) {
             this.url = url;
-            this.externalForm = url.toExternalForm();
+            externalForm = url.toExternalForm();
         }
 
         public URL getUrl() {
@@ -1998,7 +1998,7 @@ public class TaglibFactory implements TemplateHashModel {
 
         @Override
         public int compareTo(Object that) {
-            return this.getExternalForm().compareTo(((URLWithExternalForm) that).getExternalForm());
+            return getExternalForm().compareTo(((URLWithExternalForm) that).getExternalForm());
         }
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
index 4a0d89e..153cc26 100644
--- a/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
+++ b/src/test/java/org/apache/freemarker/core/ConfigurationTest.java
@@ -283,7 +283,7 @@ public class ConfigurationTest extends TestCase {
     
     public void testTemplateLoadingErrors() throws Exception {
         Configuration cfg = new Configuration(Configuration.VERSION_3_0_0);
-        cfg.setClassForTemplateLoading(this.getClass(), "nosuchpackage");
+        cfg.setClassForTemplateLoading(getClass(), "nosuchpackage");
         try {
             cfg.getTemplate("missing.ftl");
             fail();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java b/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
index 7113a2a..ff9812c 100644
--- a/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
+++ b/src/test/java/org/apache/freemarker/core/TemplateNotFoundMessageTest.java
@@ -55,7 +55,7 @@ public class TemplateNotFoundMessageTest {
 
     @Test
     public void testClassTemplateLoader() throws IOException {
-        final String errMsg = failWith(new ClassTemplateLoader(this.getClass(), "foo/bar"));
+        final String errMsg = failWith(new ClassTemplateLoader(getClass(), "foo/bar"));
         showErrorMessage(errMsg);
         assertThat(errMsg, containsString("ClassTemplateLoader"));
         assertThat(errMsg, containsString("foo/bar"));
@@ -88,7 +88,7 @@ public class TemplateNotFoundMessageTest {
     public void testMultiTemplateLoader() throws IOException {
         final String errMsg = failWith(new MultiTemplateLoader(new TemplateLoader[] {
                 new WebAppTemplateLoader(new MockServletContext(), "WEB-INF/templates"),
-                new ClassTemplateLoader(this.getClass(), "foo/bar")
+                new ClassTemplateLoader(getClass(), "foo/bar")
         }));
         showErrorMessage(errMsg);
         assertThat(errMsg, containsString("MultiTemplateLoader"));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java b/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
index f9d1840..14d6a33 100644
--- a/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
+++ b/src/test/java/org/apache/freemarker/core/ast/ObjectBuilderSettingsTest.java
@@ -1041,21 +1041,21 @@ public class ObjectBuilderSettingsTest {
         }
         
         public TestBean1(Integer i, boolean b) {
-            this.f = 2;
+            f = 2;
             this.i = i;
-            this.l = 2;
+            l = 2;
             this.b = b;
         }
     
         public TestBean1(Integer i, long l) {
-            this.f = 3;
+            f = 3;
             this.i = i;
             this.l = l;
-            this.b = false;
+            b = false;
         }
         
         public TestBean1() {
-            this.f = 4;
+            f = 4;
         }
     
         public double getP1() {
@@ -1097,18 +1097,18 @@ public class ObjectBuilderSettingsTest {
         final int x;
 
         public TestBean2() {
-            this.built = false;
-            this.x = 0;
+            built = false;
+            x = 0;
         }
         
         public TestBean2(int x) {
-            this.built = false;
+            built = false;
             this.x = x;
         }
 
         public TestBean2(TestBean2Builder builder) {
-            this.built = true;
-            this.x = builder.x;
+            built = true;
+            x = builder.x;
         }
         
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/ast/PrintfGTemplateNumberFormatFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/ast/PrintfGTemplateNumberFormatFactory.java
b/src/test/java/org/apache/freemarker/core/ast/PrintfGTemplateNumberFormatFactory.java
index 4382c4b..9236d3b 100644
--- a/src/test/java/org/apache/freemarker/core/ast/PrintfGTemplateNumberFormatFactory.java
+++ b/src/test/java/org/apache/freemarker/core/ast/PrintfGTemplateNumberFormatFactory.java
@@ -70,7 +70,7 @@ public class PrintfGTemplateNumberFormatFactory extends TemplateNumberFormatFact
         private final String printfFormat; 
 
         private PrintfGTemplateNumberFormat(Integer significantDigits, Locale locale) {
-            this.printfFormat = "%" + (significantDigits != null ? "." + significantDigits
: "") + "G";
+            printfFormat = "%" + (significantDigits != null ? "." + significantDigits : "")
+ "G";
             this.locale = locale;
         }
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
index 2ed33cf..a49ec16 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperSingletonsTest.java
@@ -354,7 +354,7 @@ public class BeansWrapperSingletonsTest extends TestCase {
         
         ClassLoader oldTCCL = Thread.currentThread().getContextClassLoader();
         // Doesn't mater what, just be different from oldTCCL: 
-        ClassLoader newTCCL = oldTCCL == null ? this.getClass().getClassLoader() : null;
+        ClassLoader newTCCL = oldTCCL == null ? getClass().getClassLoader() : null;
         
         BeansWrapper bw2;
         Thread.currentThread().setContextClassLoader(newTCCL);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
index d569b5b..6b5be38 100644
--- a/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
+++ b/src/test/java/org/apache/freemarker/core/model/impl/beans/BeansWrapperWithShortedMethods.java
@@ -29,12 +29,12 @@ import org.apache.freemarker.core.model.impl.beans.BeansWrapper;
 public abstract class BeansWrapperWithShortedMethods extends BeansWrapper {
     
     public BeansWrapperWithShortedMethods(boolean desc) {
-        this.setMethodSorter(new AlphabeticalMethodSorter(desc));
+        setMethodSorter(new AlphabeticalMethodSorter(desc));
     }
 
     public BeansWrapperWithShortedMethods(Version incompatibleImprovements, boolean desc)
{
         super(incompatibleImprovements);
-        this.setMethodSorter(new AlphabeticalMethodSorter(desc));
+        setMethodSorter(new AlphabeticalMethodSorter(desc));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/manualtest/ExamplesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/manualtest/ExamplesTest.java b/src/test/java/org/apache/freemarker/manualtest/ExamplesTest.java
index 2541478..9e32238 100644
--- a/src/test/java/org/apache/freemarker/manualtest/ExamplesTest.java
+++ b/src/test/java/org/apache/freemarker/manualtest/ExamplesTest.java
@@ -35,7 +35,7 @@ public abstract class ExamplesTest extends TemplateTest {
 
     protected Properties loadPropertiesFile(String name) throws IOException {
         Properties props = new Properties();
-        InputStream in = this.getClass().getResourceAsStream(name);
+        InputStream in = getClass().getResourceAsStream(name);
         try {
             props.load(in);
         } finally {
@@ -53,7 +53,10 @@ public abstract class ExamplesTest extends TemplateTest {
 
     protected void setupTemplateLoaders(Configuration cfg) {
         cfg.setTemplateLoader(new MultiTemplateLoader(
-                new TemplateLoader[] { new ByteArrayTemplateLoader(), new ClassTemplateLoader(this.getClass(),
"") }));
+                new TemplateLoader[] {
+                        new ByteArrayTemplateLoader(),
+                        new ClassTemplateLoader(getClass(), "")
+                }));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/servlet/InitParamParserTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/servlet/InitParamParserTest.java b/src/test/java/org/apache/freemarker/servlet/InitParamParserTest.java
index d4e8499..48b45bc 100644
--- a/src/test/java/org/apache/freemarker/servlet/InitParamParserTest.java
+++ b/src/test/java/org/apache/freemarker/servlet/InitParamParserTest.java
@@ -73,7 +73,7 @@ public class InitParamParserTest {
         {
             ClassTemplateLoader ctl = (ClassTemplateLoader) InitParamParser.createTemplateLoader(
                     "classpath:templates",
-                    cfg, this.getClass(), null);
+                    cfg, getClass(), null);
             assertEquals("templates/", ctl.getBasePackagePath());
             assertEquals(Boolean.FALSE, ctl.getURLConnectionUsesCaches());
         }
@@ -81,7 +81,7 @@ public class InitParamParserTest {
         {
             ClassTemplateLoader ctl = (ClassTemplateLoader) InitParamParser.createTemplateLoader(
                     "classpath:templates?settings(URLConnectionUsesCaches=true)",
-                    cfg, this.getClass(), null);
+                    cfg, getClass(), null);
             assertEquals("templates/", ctl.getBasePackagePath());
             assertEquals(Boolean.TRUE, ctl.getURLConnectionUsesCaches());
         }
@@ -94,7 +94,7 @@ public class InitParamParserTest {
                     + "classpath:templates, "
                     + "classpath:foo/templates?settings(URLConnectionUsesCaches=true)"
                     + "]",
-                    cfg, this.getClass(), new MockServletContext());
+                    cfg, getClass(), new MockServletContext());
 
             assertEquals(4, mtl.getTemplateLoaderCount());
             

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/test/TemplateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/TemplateTest.java b/src/test/java/org/apache/freemarker/test/TemplateTest.java
index 0575313..61ff22e 100644
--- a/src/test/java/org/apache/freemarker/test/TemplateTest.java
+++ b/src/test/java/org/apache/freemarker/test/TemplateTest.java
@@ -95,9 +95,9 @@ public abstract class TemplateTest {
         String expectedOut;
         {
             String resName = name + ".out";
-            InputStream in = this.getClass().getResourceAsStream(resName);
+            InputStream in = getClass().getResourceAsStream(resName);
             if (in == null) {
-                throw new IOException("Reference output resource not found: " + this.getClass()
+ ", " + resName);
+                throw new IOException("Reference output resource not found: " + getClass()
+ ", " + resName);
             }
             try {
                 expectedOut = TestUtil.removeTxtCopyrightComment(IOUtils.toString(in, "utf-8"));

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/test/hamcerst/StringContainsIgnoringCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/hamcerst/StringContainsIgnoringCase.java
b/src/test/java/org/apache/freemarker/test/hamcerst/StringContainsIgnoringCase.java
index d622b62..87c01bf 100644
--- a/src/test/java/org/apache/freemarker/test/hamcerst/StringContainsIgnoringCase.java
+++ b/src/test/java/org/apache/freemarker/test/hamcerst/StringContainsIgnoringCase.java
@@ -31,7 +31,7 @@ public class StringContainsIgnoringCase extends SubstringMatcher {
 
     @Override
     protected boolean evalSubstringOf(String s) {
-        return s.toLowerCase().contains(this.substring.toLowerCase());
+        return s.toLowerCase().contains(substring.toLowerCase());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
index e9ac109..720dd27 100644
--- a/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/servlet/WebAppTestCase.java
@@ -274,7 +274,7 @@ public class WebAppTestCase {
         final String appRelResPath = "webapps/" + webAppName + "/";
         final String relResPath = appRelResPath + "WEB-INF/web.xml";
 
-        Class<?> baseClass = this.getClass();
+        Class<?> baseClass = getClass();
         do {
             URL r = baseClass.getResource(relResPath);
             if (r != null) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/ee8e2096/src/test/java/org/apache/freemarker/test/util/FileTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/freemarker/test/util/FileTestCase.java b/src/test/java/org/apache/freemarker/test/util/FileTestCase.java
index ac8c86d..24728bd 100644
--- a/src/test/java/org/apache/freemarker/test/util/FileTestCase.java
+++ b/src/test/java/org/apache/freemarker/test/util/FileTestCase.java
@@ -139,7 +139,7 @@ public abstract class FileTestCase extends TestCase {
 
     @SuppressFBWarnings(value="UI_INHERITANCE_UNSAFE_GETRESOURCE", justification="By design
relative to subclass")
     protected final File getTestClassDirectory() throws IOException {
-        URL url = this.getClass().getResource(".");
+        URL url = getClass().getResource(".");
         if (url == null) throw new IOException("Couldn't get resource URL for \".\"");
         return new File(url.getFile());
     }



Mime
View raw message