tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1301272 - in /tomcat/tc7.0.x/trunk/java/org/apache: catalina/session/ catalina/users/ catalina/valves/ jasper/ jasper/compiler/
Date Thu, 15 Mar 2012 23:41:09 GMT
Author: markt
Date: Thu Mar 15 23:41:08 2012
New Revision: 1301272

URL: http://svn.apache.org/viewvc?rev=1301272&view=rev
Log:
Add finals

Modified:
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardManager.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardManager.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardManager.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/session/StandardManager.java Thu Mar 15
23:41:08 2012
@@ -107,7 +107,7 @@ public class StandardManager extends Man
     /**
      * The descriptive name of this Manager implementation (for logging).
      */
-    protected static String name = "StandardManager";
+    protected static final String name = "StandardManager";
 
 
     /**

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java Thu Mar 15
23:41:08 2012
@@ -58,9 +58,7 @@ public class MemoryUserDatabase implemen
      * Create a new instance with default values.
      */
     public MemoryUserDatabase() {
-
-        super();
-
+        this(null);
     }
 
 
@@ -70,10 +68,7 @@ public class MemoryUserDatabase implemen
      * @param id Unique global identifier of this user database
      */
     public MemoryUserDatabase(String id) {
-
-        super();
         this.id = id;
-
     }
 
 
@@ -84,13 +79,13 @@ public class MemoryUserDatabase implemen
      * The set of {@link Group}s defined in this database, keyed by
      * group name.
      */
-    protected HashMap<String,Group> groups = new HashMap<String,Group>();
+    protected final HashMap<String,Group> groups = new HashMap<String,Group>();
 
 
     /**
      * The unique global identifier of this user database.
      */
-    protected String id = null;
+    protected final String id;
 
 
     /**
@@ -123,7 +118,7 @@ public class MemoryUserDatabase implemen
      * The set of {@link Role}s defined in this database, keyed by
      * role name.
      */
-    protected HashMap<String,Role> roles = new HashMap<String,Role>();
+    protected final HashMap<String,Role> roles = new HashMap<String,Role>();
 
 
     /**
@@ -137,7 +132,7 @@ public class MemoryUserDatabase implemen
      * The set of {@link User}s defined in this database, keyed by
      * user name.
      */
-    protected HashMap<String,User> users = new HashMap<String,User>();
+    protected final HashMap<String,User> users = new HashMap<String,User>();
 
 
     // ------------------------------------------------------------- Properties

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/CometConnectionManagerValve.java
Thu Mar 15 23:41:08 2012
@@ -73,14 +73,14 @@ public class CometConnectionManagerValve
     /**
      * List of current Comet connections.
      */
-    protected List<Request> cometRequests =
+    protected final List<Request> cometRequests =
         Collections.synchronizedList(new ArrayList<Request>());
 
 
     /**
      * Name of session attribute used to store list of comet connections.
      */
-    protected String cometRequestsAttribute =
+    protected final String cometRequestsAttribute =
         "org.apache.tomcat.comet.connectionList";
 
 

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/JspC.java Thu Mar 15 23:41:08 2012
@@ -171,7 +171,7 @@ public class JspC implements Options {
     protected boolean smapSuppressed = true;
     protected boolean smapDumped = false;
     protected boolean caching = true;
-    protected Map<String, TagLibraryInfo> cache =
+    protected final Map<String, TagLibraryInfo> cache =
         new HashMap<String, TagLibraryInfo>();
 
     protected String compiler = null;
@@ -196,7 +196,7 @@ public class JspC implements Options {
     /**
      * The pages.
      */
-    protected List<String> pages = new Vector<String>();
+    protected final List<String> pages = new Vector<String>();
 
     /**
      * Needs better documentation, this data member does.

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Generator.java Thu Mar 15 23:41:08
2012
@@ -95,35 +95,35 @@ class Generator {
                     "org.apache.jasper.compiler.Generator.STRICT_GET_PROPERTY",
                     "true")).booleanValue();
 
-    private ServletWriter out;
+    private final ServletWriter out;
 
-    private ArrayList<GenBuffer> methodsBuffered;
+    private final ArrayList<GenBuffer> methodsBuffered;
 
-    private FragmentHelperClass fragmentHelperClass;
+    private final FragmentHelperClass fragmentHelperClass;
 
-    private ErrorDispatcher err;
+    private final ErrorDispatcher err;
 
-    private BeanRepository beanInfo;
+    private final BeanRepository beanInfo;
     
-    private Set<String> varInfoNames;
+    private final Set<String> varInfoNames;
 
-    private JspCompilationContext ctxt;
+    private final JspCompilationContext ctxt;
 
-    private boolean isPoolingEnabled;
+    private final boolean isPoolingEnabled;
 
-    private boolean breakAtLF;
+    private final boolean breakAtLF;
 
     private String jspIdPrefix;
 
     private int jspId;
 
-    private PageInfo pageInfo;
+    private final PageInfo pageInfo;
 
-    private Vector<String> tagHandlerPoolNames;
+    private final Vector<String> tagHandlerPoolNames;
 
     private GenBuffer charArrayBuffer;
     
-    private DateFormat timestampFormat;
+    private final DateFormat timestampFormat;
 
     /**
      * @param s
@@ -276,7 +276,7 @@ class Generator {
 
         class TagHandlerPoolVisitor extends Node.Visitor {
 
-            private Vector<String> names;
+            private final Vector<String> names;
 
             /*
              * Constructor
@@ -354,7 +354,7 @@ class Generator {
 
         class ScriptingVarVisitor extends Node.Visitor {
 
-            private Vector<String> vars;
+            private final Vector<String> vars;
 
             ScriptingVarVisitor() {
                 vars = new Vector<String>();
@@ -754,9 +754,9 @@ class Generator {
          * handlers: <key>: tag short name <value>: introspection info of tag
          * handler for <prefix:shortName> tag
          */
-        private Hashtable<String,Hashtable<String,TagHandlerInfo>> handlerInfos;
+        private final Hashtable<String,Hashtable<String,TagHandlerInfo>> handlerInfos;
 
-        private Hashtable<String,Integer> tagVarNumbers;
+        private final Hashtable<String,Integer> tagVarNumbers;
 
         private String parent;
 
@@ -770,13 +770,13 @@ class Generator {
 
         private boolean isFragment;
 
-        private boolean isTagFile;
+        private final boolean isTagFile;
 
         private ServletWriter out;
 
-        private ArrayList<GenBuffer> methodsBuffered;
+        private final ArrayList<GenBuffer> methodsBuffered;
 
-        private FragmentHelperClass fragmentHelperClass;
+        private final FragmentHelperClass fragmentHelperClass;
 
         private int methodNesting;
 
@@ -1401,7 +1401,7 @@ class Generator {
              */
             class ParamVisitor extends Node.Visitor {
 
-                private boolean ie;
+                private final boolean ie;
 
                 ParamVisitor(boolean ie) {
                     this.ie = ie;
@@ -3443,6 +3443,8 @@ class Generator {
         breakAtLF = ctxt.getOptions().getMappedFile();
         if (isPoolingEnabled) {
             tagHandlerPoolNames = new Vector<String>();
+        } else {
+            tagHandlerPoolNames = null;
         }
         timestampFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         timestampFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

Modified: tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java?rev=1301272&r1=1301271&r2=1301272&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/JDTCompiler.java Thu Mar 15 23:41:08
2012
@@ -107,12 +107,13 @@ public class JDTCompiler extends org.apa
             public char[] getContents() {
                 char[] result = null;
                 FileInputStream is = null;
+                InputStreamReader isr = null;
                 Reader reader = null;
                 try {
                     is = new FileInputStream(sourceFile);
-                     
-                    reader = new BufferedReader(new InputStreamReader(is,
-                            ctxt.getOptions().getJavaEncoding()));
+                    isr = new InputStreamReader(is,
+                            ctxt.getOptions().getJavaEncoding());
+                    reader = new BufferedReader(isr);
                     char[] chars = new char[8192];
                     StringBuilder buf = new StringBuilder();
                     int count;
@@ -130,6 +131,11 @@ public class JDTCompiler extends org.apa
                             reader.close();
                         } catch (IOException ioe) {/*Ignore*/}
                     }
+                    if (isr != null) {
+                        try {
+                            isr.close();
+                        } catch (IOException ioe) {/*Ignore*/}
+                    }
                     if (is != null) {
                         try {
                             is.close();



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message