geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r955206 - in /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src: main/java/org/apache/geronimo/tomcat/ main/java/org/apache/geronimo/tomcat/connector/ main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/ test/java/or...
Date Wed, 16 Jun 2010 11:43:52 GMT
Author: xuhaihong
Date: Wed Jun 16 11:43:51 2010
New Revision: 955206

URL: http://svn.apache.org/viewvc?rev=955206&view=rev
Log:
a. Use Boolean/Integer.valueOf
b. Use Map.Entry as iterator item
c. Make sure all the stream objects are closed

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatLogManagerImpl.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/BaseHttp11ConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11NIOConnectorGBean.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicAuthenticator.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ApplicationTest.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ContainerTest.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/StatTest.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/ManagerGBean.java Wed Jun 16 11:43:51 2010
@@ -17,7 +17,6 @@
 package org.apache.geronimo.tomcat;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -112,13 +111,13 @@ public class ManagerGBean extends BaseGB
 
     static class DefaultParametersHandler implements ParametersHandler {
         public void handle(Object managerObject, Map<String, String> nameValueMap) throws Exception {
-            for (Iterator<String> it = nameValueMap.keySet().iterator(); it.hasNext();) {
-                String sCurrentParameterName = it.next();
-                String sCurrentParameterValue = nameValueMap.get(sCurrentParameterName);
-                if (sCurrentParameterValue != null) {
-                    sCurrentParameterValue = sCurrentParameterValue.trim();
+            for (Entry<String,String> entry : nameValueMap.entrySet()) {
+                String currentParameterName = entry.getKey();
+                String currentParameterValue = entry.getValue();
+                if (currentParameterValue != null) {
+                    currentParameterValue = currentParameterValue.trim();
                 }
-                IntrospectionUtils.setProperty(managerObject, sCurrentParameterName, sCurrentParameterValue);
+                IntrospectionUtils.setProperty(managerObject, currentParameterName, currentParameterValue);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java Wed Jun 16 11:43:51 2010
@@ -159,7 +159,7 @@ public class TomcatEJBWebServiceContext 
         }
 
         public int getMethod() {
-            Integer method = (Integer) methods.get(request.getMethod());
+            Integer method = methods.get(request.getMethod());
             return method == null ? UNSUPPORTED : method.intValue();
         }
 
@@ -187,17 +187,17 @@ public class TomcatEJBWebServiceContext 
             return request.getContextPath();
         }
 
-        private static final Map methods = new HashMap();
+        private static final Map<String, Integer> methods = new HashMap<String, Integer>();
 
         static {
-            methods.put("OPTIONS", new Integer(OPTIONS));
-            methods.put("GET", new Integer(GET));
-            methods.put("HEAD", new Integer(HEAD));
-            methods.put("POST", new Integer(POST));
-            methods.put("PUT", new Integer(PUT));
-            methods.put("DELETE", new Integer(DELETE));
-            methods.put("TRACE", new Integer(TRACE));
-            methods.put("CONNECT", new Integer(CONNECT));
+            methods.put("OPTIONS", Integer.valueOf(OPTIONS));
+            methods.put("GET", Integer.valueOf(GET));
+            methods.put("HEAD", Integer.valueOf(HEAD));
+            methods.put("POST", Integer.valueOf(POST));
+            methods.put("PUT", Integer.valueOf(PUT));
+            methods.put("DELETE", Integer.valueOf(DELETE));
+            methods.put("TRACE", Integer.valueOf(TRACE));
+            methods.put("CONNECT", Integer.valueOf(CONNECT));
         }
 
     }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatLogManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatLogManagerImpl.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatLogManagerImpl.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatLogManagerImpl.java Wed Jun 16 11:43:51 2010
@@ -79,11 +79,11 @@ public class TomcatLogManagerImpl implem
     private final static String LOG_FILE_NAME_FORMAT = "yyyy-MM-dd";
     private List<AccessLogValve> accessLogValves;
     private final ServerInfo serverInfo;
-    private TomcatServerGBean tomcatServer;    
+    private TomcatServerGBean tomcatServer;
 
     public TomcatLogManagerImpl(ServerInfo serverInfo, TomcatServerGBean tomcatServer) {
         this.serverInfo = serverInfo;
-        this.tomcatServer = tomcatServer;        
+        this.tomcatServer = tomcatServer;
     }
 
     /**
@@ -98,11 +98,11 @@ public class TomcatLogManagerImpl implem
         for (AccessLogValve accessLogValve : accessLogValves) {
             logNames.add("var/catalina/logs/" + accessLogValve.getPrefix() + LOG_FILE_NAME_FORMAT + accessLogValve.getSuffix());
         }
-        return (String[]) logNames.toArray(new String[logNames.size()]);
+        return logNames.toArray(new String[logNames.size()]);
     }
 
     /**
-     * Gets the names of all log files for this log name.  
+     * Gets the names of all log files for this log name.
      *
      * @param logName The name of the log for which to return the specific file names.
      *
@@ -120,7 +120,7 @@ public class TomcatLogManagerImpl implem
                 names.add(logFiles[i].getName());
             }
         }
-        return (String[]) names.toArray(new String[names.size()]);
+        return names.toArray(new String[names.size()]);
     }
 
     /**
@@ -186,7 +186,7 @@ public class TomcatLogManagerImpl implem
         if (logFiles !=null) {
             for (int i = 0; i < logFiles.length; i++) {
                 fileLineCount = 0;
-                FileInputStream logInputStream = null;
+                BufferedReader reader = null;
                 try {
                     // Obtain the date for the current log file
                     String fileName = logFiles[i].getName();
@@ -200,8 +200,7 @@ public class TomcatLogManagerImpl implem
                        || (start>0 && start<=logFileTime && end>0 && end>=logFileTime)) {
 
                         // It's in the range, so process the file
-                        logInputStream = new FileInputStream(logFiles[i]);
-                        BufferedReader reader = new BufferedReader(new InputStreamReader(logInputStream, "US-ASCII"));
+                        reader = new BufferedReader(new InputStreamReader(new FileInputStream(logFiles[i]), "US-ASCII"));
 
                         Matcher target = ACCESS_LOG_PATTERN.matcher("");
                         SimpleDateFormat format = (start == 0 && end == 0) ? null : new SimpleDateFormat(ACCESS_LOG_DATE_FORMAT);
@@ -255,9 +254,9 @@ public class TomcatLogManagerImpl implem
                 } catch (Exception e) {
                     log.error("Unexpected error processing logs", e);
                 } finally {
-                    if (logInputStream != null) {
+                    if (reader != null) {
                         try {
-                            logInputStream.close();
+                            reader.close();
                         } catch (IOException e) {
                             // ignore
                         }
@@ -265,15 +264,15 @@ public class TomcatLogManagerImpl implem
                 }
             }
         }
-        return new SearchResults(lineCount, (LogMessage[]) list.toArray(new LogMessage[list.size()]), capped);
+        return new SearchResults(lineCount, list.toArray(new LogMessage[list.size()]), capped);
     }
 
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Tomcat Log Manager", TomcatLogManagerImpl.class);        
-        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");       
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("Tomcat Log Manager", TomcatLogManagerImpl.class);
+        infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
         infoFactory.addReference("Server", TomcatServerGBean.class);
         infoFactory.addInterface(TomcatLogManager.class);
         infoFactory.setConstructor(new String[] { "ServerInfo", "Server" });
@@ -305,11 +304,11 @@ public class TomcatLogManagerImpl implem
             return pattern.matcher(fileName).matches();
         }
     }
-    
-    public void doFail() {       
+
+    public void doFail() {
     }
 
-    public void doStart() throws Exception {        
+    public void doStart() throws Exception {
         //Find all the access log valves and add them to the list
         //Valve could be added on Engine/Host/Context
         Server server = tomcatServer.getServer();
@@ -342,7 +341,7 @@ public class TomcatLogManagerImpl implem
         }
     }
 
-    public void doStop() throws Exception {        
+    public void doStop() throws Exception {
     }
 
 /*

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -39,14 +39,14 @@ import org.apache.geronimo.tomcat.stats.
 
 @GBean(name="Tomcat Connector AJP")
 public class AJP13ConnectorGBean extends ConnectorGBean implements Ajp13Protocol, StatisticsProvider {
-    
+
     // JSR77 stats
     private ConnectorStats connStatsProvider = new ConnectorStats();
 
     private boolean reset = true;
 
     protected String connectHost;
-    
+
     public AJP13ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
                                @ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
                                @ParamAttribute(manageable=false, name = "host") String host,
@@ -54,10 +54,10 @@ public class AJP13ConnectorGBean extends
                                @ParamReference(name = "TomcatContainer") TomcatContainer container,
                                @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
                                @ParamAttribute(manageable=false, name = "connector") Connector conn)  throws Exception {
-    
+
 
         super(name, initParams, "AJP/1.3", container, serverInfo, conn);
-        
+
         // Default the host to listen on all address is one was not specified
         if (host == null) {
             host = "0.0.0.0";
@@ -72,11 +72,11 @@ public class AJP13ConnectorGBean extends
         connector.setPort(port);
 
     }
-    
+
     public String getGeronimoProtocol(){
         return WebManager.PROTOCOL_AJP;
     }
-    
+
     public String getConnectUrl() {
         if(connectHost == null) {
             String host = getAddress();
@@ -94,24 +94,24 @@ public class AJP13ConnectorGBean extends
                     }
                 }
             }
-            // this host address could be in IPv6 format, 
+            // this host address could be in IPv6 format,
             // which means we need to wrap it in brackets
             if (host.indexOf(":") >= 0) {
-                host = "[" + host + "]"; 
+                host = "[" + host + "]";
             }
             connectHost = host;
         }
         return getScheme().toLowerCase()+"://"+connectHost+(getPort() == getDefaultPort() ? "" : ":"+getPort());
     }
-    
+
     public int getDefaultPort() {
-        return -1; 
-    }  
-    
+        return -1;
+    }
+
     public InetSocketAddress getListenAddress() {
         return new InetSocketAddress(getHost(), getPort());
     }
-    
+
     public String getAddress() {
         Object value = connector.getAttribute("address");
         if (value == null) {
@@ -120,7 +120,7 @@ public class AJP13ConnectorGBean extends
             return ((InetAddress) value).getHostAddress();
         } else
             return value.toString();
-    } 
+    }
 
     public int getBacklog() {
         Object value = connector.getAttribute("backlog");
@@ -141,17 +141,17 @@ public class AJP13ConnectorGBean extends
     	 Object value = connector.getAttribute("executor");
          if (value == null)
              return null;
-         
+
          if (value instanceof String)
              return (String)value;
-         
+
          if(value instanceof Executor){
          	return ((Executor) value).getName();
          }
-         
-         return (String) value.getClass().getName();
+
+         return value.getClass().getName();
     }
-    
+
     public String getHost() {
         return getAddress();
     }
@@ -165,101 +165,101 @@ public class AJP13ConnectorGBean extends
         Object value = connector.getAttribute("maxThreads");
         return value == null ? 200 : Integer.parseInt(value.toString());
     }
-    
+
     public int getMaxSpareThreads() {
         Object value = connector.getAttribute("maxSpareThreads");
         return value == null ? 100 : Integer.parseInt(value.toString());
     }
-    
+
     public int getMinSpareThreads() {
         Object value = connector.getAttribute("minSpareThreads");
         return value == null ? 10 : Integer.parseInt(value.toString());
     }
-    
+
     public int getPort() {
         return connector.getPort();
     }
 
     public boolean getTcpNoDelay() {
         Object value = connector.getAttribute("tcpNoDelay");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public boolean getTomcatAuthentication() {
         Object value = connector.getAttribute("tomcatAuthentication");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
-    
+
     @Persistent(manageable=false)
     public void setAddress(String address) {
         connector.setAttribute("address", address);
     }
-    
+
     @Persistent(manageable=false)
     public void setBacklog(int backlog) {
-        connector.setAttribute("backlog", new Integer(backlog));
+        connector.setAttribute("backlog", Integer.valueOf(backlog));
     }
-    
+
     @Persistent(manageable=false)
     public void setBufferSize(int bufferSize) {
-        connector.setAttribute("bufferSize", new Integer(bufferSize));
+        connector.setAttribute("bufferSize", Integer.valueOf(bufferSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setConnectionTimeout(int connectionTimeout) {
-        connector.setAttribute("connectionTimeout", new Integer(connectionTimeout));
+        connector.setAttribute("connectionTimeout", Integer.valueOf(connectionTimeout));
     }
-    
+
     @Persistent(manageable=false)
     public void setExecutor(String executor) {
         connector.setAttribute("executor", executor);
     }
-    
+
     @Persistent(manageable=false)
     public void setHost(String host) {
         setAddress(host);
     }
-    
+
     @Persistent(manageable=false)
     public void setKeepAliveTimeout(int keepAliveTimeout) {
-        connector.setAttribute("keepAliveTimeout", keepAliveTimeout);        
+        connector.setAttribute("keepAliveTimeout", keepAliveTimeout);
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxThreads(int maxThreads) {
-        connector.setAttribute("maxThreads", maxThreads);        
+        connector.setAttribute("maxThreads", maxThreads);
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxSpareThreads(int maxSpareThreads) {
-        connector.setAttribute("maxSpareThreads", new Integer(maxSpareThreads));
+        connector.setAttribute("maxSpareThreads", Integer.valueOf(maxSpareThreads));
     }
-    
-    @Persistent(manageable=false) 
+
+    @Persistent(manageable=false)
     public void setMinSpareThreads(int minSpareThreads) {
-        connector.setAttribute("minSpareThreads", new Integer(minSpareThreads));
+        connector.setAttribute("minSpareThreads", Integer.valueOf(minSpareThreads));
     }
-    
+
     @Persistent(manageable=false)
     public void setNoCompressionUserAgents(String noCompressionUserAgents) {
         connector.setAttribute("noCompressionUserAgents", noCompressionUserAgents);
     }
-    
+
     @Persistent(manageable=false)
     public void setPort(int port) {
         connector.setPort(port);
     }
-    
+
     @Persistent(manageable=false)
     public void setTcpNoDelay(boolean tcpNoDelay) {
-        connector.setAttribute("tcpNoDelay", new Boolean(tcpNoDelay));
+        connector.setAttribute("tcpNoDelay", Boolean.valueOf(tcpNoDelay));
     }
-    
+
     @Persistent(manageable=false)
     public void setTomcatAuthentication(boolean tomcatAuthentication) {
-        connector.setAttribute("tomcatAuthentication", new Boolean(tomcatAuthentication));
+        connector.setAttribute("tomcatAuthentication", Boolean.valueOf(tomcatAuthentication));
     }
-    
+
     // Statistics Provider
 
     public boolean isStatisticsProvider() {
@@ -278,6 +278,6 @@ public class AJP13ConnectorGBean extends
     public void resetStats() {
         reset = true;
     }
-    
-   
+
+
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/AbstractHttp11ConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -38,7 +38,7 @@ public abstract class AbstractHttp11Conn
     private String truststoreFileName;
 
     private String algorithm;
-    
+
     public AbstractHttp11ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
                                         @ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
                                         @ParamAttribute(manageable=false, name = "protocol") String tomcatProtocol,
@@ -47,7 +47,7 @@ public abstract class AbstractHttp11Conn
                                         @ParamReference(name = "TomcatContainer") TomcatContainer container,
                                         @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
                                         @ParamAttribute(manageable=false, name = "connector") Connector conn)  throws Exception {
-                                        
+
         super(name, initParams, tomcatProtocol, host, port, container, serverInfo, conn);
     }
 
@@ -60,10 +60,10 @@ public abstract class AbstractHttp11Conn
     public String getGeronimoProtocol() {
         return WebManager.PROTOCOL_HTTP;
     }
-    
+
     // Generic SSL
     public String getAlgorithm() {
-        
+
         if ("default".equalsIgnoreCase(algorithm)) {
             return KeyManagerFactory.getDefaultAlgorithm();
         }
@@ -86,7 +86,7 @@ public abstract class AbstractHttp11Conn
     public String getKeystoreFile() {
 
         String keystore = (String) connector.getAttribute("keystoreFile");
-        
+
         return getRelatedPathtoCatalinaHome(keystore);
 
     }
@@ -100,9 +100,9 @@ public abstract class AbstractHttp11Conn
     }
 
     public String getTruststoreFile() {
-        
+
         String truststoreFile = (String) connector.getAttribute("truststoreFile");
-        
+
         return getRelatedPathtoCatalinaHome(truststoreFile);
 
     }
@@ -114,11 +114,11 @@ public abstract class AbstractHttp11Conn
     public String getTruststorePass() {
         return (String) connector.getAttribute("truststorePass");
     }
-    
+
     public String getKeystorePass() {
         return (String) connector.getAttribute("keystorePass");
     }
-    
+
     @Persistent(manageable=false)
     public void setAlgorithm(String algorithm) {
         this.algorithm = algorithm;
@@ -132,7 +132,7 @@ public abstract class AbstractHttp11Conn
     public void setCiphers(String ciphers) {
         connector.setAttribute("ciphers", ciphers);
     }
-    
+
     @Persistent(manageable=false)
     public void setClientAuth(String clientAuth) {
         connector.setAttribute("clientAuth", clientAuth);
@@ -147,11 +147,11 @@ public abstract class AbstractHttp11Conn
 
     @Persistent(manageable=false)
     public void setKeystoreFile(String keystoreFile) {
-        if (keystoreFile!= null && keystoreFile.equals("")) 
+        if (keystoreFile!= null && keystoreFile.equals(""))
             keystoreFile = null;
-        
+
         keystoreFileName = keystoreFile;
-        
+
         if (keystoreFileName == null) {
 
             connector.setAttribute("keystoreFile", keystoreFileName);
@@ -159,42 +159,42 @@ public abstract class AbstractHttp11Conn
         } else {
 
             String resovledAbsolutePath = this.getAbsolutePathBasedOnCatalinaHome(keystoreFileName);
-            
+
             if (resovledAbsolutePath != null)
                 connector.setAttribute("keystoreFile", resovledAbsolutePath);
 
         }
-        
+
     }
-    
+
 
     @Persistent(manageable=false)
     public void setKeystorePass(String keystorePass) {
-        if (keystorePass!= null && keystorePass.equals("")) 
+        if (keystorePass!= null && keystorePass.equals(""))
             keystorePass = null;
         connector.setAttribute("keystorePass", keystorePass);
     }
 
     @Persistent(manageable=false)
     public void setKeystoreType(String keystoreType) {
-        if (keystoreType!= null && keystoreType.equals("")) 
+        if (keystoreType!= null && keystoreType.equals(""))
             keystoreType = null;
         connector.setAttribute("keystoreType", keystoreType);
     }
 
     @Persistent(manageable=false)
     public void setSslProtocol(String sslProtocol) {
-        if (sslProtocol!= null && sslProtocol.equals("")) 
+        if (sslProtocol!= null && sslProtocol.equals(""))
             sslProtocol = null;
         connector.setAttribute("sslProtocol", sslProtocol);
     }
 
     @Persistent(manageable=false)
     public void setTruststoreFile(String truststoreFile) {
-        if (truststoreFile!= null && truststoreFile.equals("")) 
+        if (truststoreFile!= null && truststoreFile.equals(""))
             truststoreFile = null;
         truststoreFileName = truststoreFile;
-        
+
         if (truststoreFileName == null) {
             connector.setAttribute("truststoreFile", null);
         }
@@ -208,20 +208,20 @@ public abstract class AbstractHttp11Conn
         }
 
     }
-    
+
     @Persistent(manageable=false)
     public void setTruststorePass(String truststorePass) {
-        if (truststorePass!= null && truststorePass.equals("")) 
+        if (truststorePass!= null && truststorePass.equals(""))
             truststorePass = null;
         connector.setAttribute("truststorePass", truststorePass);
     }
-    
+
     @Persistent(manageable=false)
     public void setTruststoreType(String truststoreType) {
-        if (truststoreType!= null && truststoreType.equals("")) 
+        if (truststoreType!= null && truststoreType.equals(""))
             truststoreType = null;
         connector.setAttribute("truststoreType", truststoreType);
     }
 
-    
+
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/BaseHttp11ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/BaseHttp11ConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/BaseHttp11ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/BaseHttp11ConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -41,7 +41,7 @@ import org.apache.geronimo.tomcat.stats.
 public abstract class BaseHttp11ConnectorGBean extends ConnectorGBean implements BaseHttp11Protocol, StatisticsProvider {
 
     protected String connectHost;
-    
+
     // JSR77 stats
     private ConnectorStats connStatsProvider = new ConnectorStats();
 
@@ -55,7 +55,7 @@ public abstract class BaseHttp11Connecto
                                     @ParamReference(name = "TomcatContainer") TomcatContainer container,
                                     @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
                                     @ParamAttribute(manageable=false, name = "connector") Connector conn)  throws Exception {
-                                    
+
         super(name, initParams, tomcatProtocol, container, serverInfo, conn);
 
         // Default the host to listen on all address is one was not specified
@@ -70,11 +70,11 @@ public abstract class BaseHttp11Connecto
 
         connector.setAttribute("address", host);
         connector.setPort(port);
-        
+
     }
-    
+
     protected void initProtocol() {}
-    
+
     public String getConnectUrl() {
         if(connectHost == null) {
             String host = getAddress();
@@ -92,16 +92,16 @@ public abstract class BaseHttp11Connecto
                     }
                 }
             }
-            // this host address could be in IPv6 format, 
+            // this host address could be in IPv6 format,
             // which means we need to wrap it in brackets
             if (host.indexOf(":") >= 0) {
-                host = "[" + host + "]"; 
+                host = "[" + host + "]";
             }
             connectHost = host;
         }
         return getScheme().toLowerCase()+"://"+connectHost+(getPort() == getDefaultPort() ? "" : ":"+getPort());
     }
-    
+
     public abstract int getDefaultPort();
 
 
@@ -146,28 +146,28 @@ public abstract class BaseHttp11Connecto
 
     public boolean getDisableUploadTimeout() {
         Object value = connector.getAttribute("disableUploadTimeout");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public String getExecutor() {
         Object value = connector.getAttribute("executor");
         if (value == null)
             return null;
-        
+
         if (value instanceof String)
             return (String)value;
-        
+
         if(value instanceof Executor){
             return ((Executor) value).getName();
         }
-        
-        return (String) value.getClass().getName();
+
+        return value.getClass().getName();
     }
-    
+
     public String getHost() {
         return getAddress();
     }
-    
+
     public InetSocketAddress getListenAddress() {
         return new InetSocketAddress(getHost(), getPort());
     }
@@ -191,12 +191,12 @@ public abstract class BaseHttp11Connecto
         Object value = connector.getAttribute("maxThreads");
         return value == null ? 200 : Integer.parseInt(value.toString());
     }
-    
+
     public int getMaxSpareThreads() {
         Object value = connector.getAttribute("maxSpareThreads");
         return value == null ? 100 : Integer.parseInt(value.toString());
     }
-    
+
     public int getMinSpareThreads() {
         Object value = connector.getAttribute("minSpareThreads");
         return value == null ? 10 : Integer.parseInt(value.toString());
@@ -225,95 +225,95 @@ public abstract class BaseHttp11Connecto
 
     public boolean getTcpNoDelay() {
         Object value = connector.getAttribute("tcpNoDelay");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
-    
+
 
     public int getThreadPriority() {
         Object value = connector.getAttribute("threadPriority");
         return value == null ? Thread.NORM_PRIORITY : Integer.parseInt(value.toString());
     }
-    
+
 
     public void setAcceptCount(int acceptCount) {
-        connector.setAttribute("acceptCount", new Integer(acceptCount));
+        connector.setAttribute("acceptCount", Integer.valueOf(acceptCount));
     }
-    
+
     @Persistent(manageable=false)
     public void setAddress(String address) {
         connector.setAttribute("address", address);
     }
-    
+
     @Persistent(manageable=false)
     public void setBufferSize(int bufferSize) {
-        connector.setAttribute("bufferSize", new Integer(bufferSize));
+        connector.setAttribute("bufferSize", Integer.valueOf(bufferSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setCompressableMimeType(String compressableMimeType) {
         connector.setAttribute("compressableMimeType", compressableMimeType);
     }
-    
+
     @Persistent(manageable=false)
     public void setCompression(String compression) {
         connector.setAttribute("compression", compression);
     }
-    
+
     @Persistent(manageable=false)
     public void setConnectionLinger(int connectionLinger) {
-        connector.setAttribute("connectionLinger", new Integer(connectionLinger));
+        connector.setAttribute("connectionLinger", Integer.valueOf(connectionLinger));
     }
-    
+
     @Persistent(manageable=false)
     public void setConnectionTimeout(int connectionTimeout) {
-        connector.setAttribute("connectionTimeout", new Integer(connectionTimeout));
+        connector.setAttribute("connectionTimeout", Integer.valueOf(connectionTimeout));
     }
-    
+
     @Persistent(manageable=false)
     public void setDisableUploadTimeout(boolean disableUploadTimeout) {
-        connector.setAttribute("disableUploadTimeout", new Boolean(disableUploadTimeout));
+        connector.setAttribute("disableUploadTimeout", Boolean.valueOf(disableUploadTimeout));
     }
-    
+
     @Persistent(manageable=false)
     public void setExecutor(String executor) {
         connector.setAttribute("executor", executor);
     }
-    
+
     @Persistent(manageable=false)
     public void setHost(String host) {
         setAddress(host);
     }
-    
+
     @Persistent(manageable=false)
     public void setKeepAliveTimeout(int keepAliveTimeout) {
         connector.setAttribute("keepAliveTimeout", keepAliveTimeout);
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxHttpHeaderSize(int maxHttpHeaderSize) {
-        connector.setAttribute("maxHttpHeaderSize", new Integer(maxHttpHeaderSize));
+        connector.setAttribute("maxHttpHeaderSize", Integer.valueOf(maxHttpHeaderSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxKeepAliveRequests(int maxKeepAliveRequests) {
-        connector.setAttribute("maxKeepAliveRequests", new Integer(maxKeepAliveRequests));
+        connector.setAttribute("maxKeepAliveRequests",Integer.valueOf(maxKeepAliveRequests));
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxThreads(int maxThreads) {
-        connector.setAttribute("maxThreads", new Integer(maxThreads));
+        connector.setAttribute("maxThreads", Integer.valueOf(maxThreads));
     }
-    
+
     @Persistent(manageable=false)
     public void setMaxSpareThreads(int maxSpareThreads) {
-        connector.setAttribute("maxSpareThreads", new Integer(maxSpareThreads));
+        connector.setAttribute("maxSpareThreads", Integer.valueOf(maxSpareThreads));
     }
-    
+
     @Persistent(manageable=false)
     public void setMinSpareThreads(int minSpareThreads) {
-        connector.setAttribute("minSpareThreads", new Integer(minSpareThreads));
+        connector.setAttribute("minSpareThreads", Integer.valueOf(minSpareThreads));
     }
-    
+
     @Persistent(manageable=false)
     public void setNoCompressionUserAgents(String noCompressionUserAgents) {
         connector.setAttribute("noCompressionUserAgents", noCompressionUserAgents);
@@ -326,27 +326,27 @@ public abstract class BaseHttp11Connecto
     public void setRestrictedUserAgents(String restrictedUserAgents) {
         connector.setAttribute("restrictedUserAgents", restrictedUserAgents);
     }
-    
+
     @Persistent(manageable=false)
     public void setServer(String server) {
         if (server.equals(""))
             server = null;
         connector.setAttribute("server", server);
     }
-    
+
     @Persistent(manageable=false)
     public void setSocketBuffer(int socketBuffer) {
-        connector.setAttribute("socketBuffer", new Integer(socketBuffer));
+        connector.setAttribute("socketBuffer", Integer.valueOf(socketBuffer));
     }
-    
+
     @Persistent(manageable=false)
     public void setTcpNoDelay(boolean tcpNoDelay) {
-        connector.setAttribute("tcpNoDelay", new Boolean(tcpNoDelay));
+        connector.setAttribute("tcpNoDelay", Boolean.valueOf(tcpNoDelay));
     }
-    
+
     @Persistent(manageable=false)
     public void setThreadPriority(int threadPriority) {
-        connector.setAttribute("threadPriority", new Integer(threadPriority));
+        connector.setAttribute("threadPriority", Integer.valueOf(threadPriority));
     }
 
     // Statistics Provider
@@ -367,7 +367,7 @@ public abstract class BaseHttp11Connecto
     public void resetStats() {
         reset = true;
     }
-    
+
     protected String getRelatedPathtoCatalinaHome(String path) {
 
         if (null != path && path.indexOf(System.getProperty("catalina.home")) != -1) {
@@ -386,14 +386,14 @@ public abstract class BaseHttp11Connecto
         if (new File(path).isAbsolute()) {
             return path;
         }
-      
-        
+
+
         File file= new File(new File(System.getProperty("catalina.home")), path);
 
         return file.getAbsolutePath();
-        
+
 
     }
 
-    
+
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -307,7 +307,7 @@ public abstract class ConnectorGBean ext
 
     public boolean getSslEnabled() {
         Object value = connector.getAttribute("SSLEnabled");
-        return value == null ? false : new Boolean(value.toString()).booleanValue();
+        return value == null ? false : Boolean.valueOf(value.toString());
     }
 
     @Persistent(manageable=false)

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11APRConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -39,7 +39,7 @@ public class Http11APRConnectorGBean ext
     private String certificateChainFile;
     private String revocationPath;
     private String revocationFile;
-    
+
     public Http11APRConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
                                    @ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
                                    @ParamAttribute(manageable=false, name = "host") String host,
@@ -47,7 +47,7 @@ public class Http11APRConnectorGBean ext
                                    @ParamReference(name = "TomcatContainer") TomcatContainer container,
                                    @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
                                    @ParamAttribute(manageable=false, name = "connector") Connector conn)  throws Exception {
-                                   
+
         super(name, initParams, "org.apache.coyote.http11.Http11AprProtocol", host, port, container, serverInfo, conn);
     }
 
@@ -104,7 +104,7 @@ public class Http11APRConnectorGBean ext
     public String getSslCipherSuite() {
         return (String) connector.getAttribute("SSLCipherSuite");
     }
-    
+
     public String getSslProtocol() {
         return (String) connector.getAttribute("SSLProtocol");
     }
@@ -130,34 +130,34 @@ public class Http11APRConnectorGBean ext
 
     public boolean getUseSendfile() {
         Object value = connector.getAttribute("useSendfile");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
-    
+
     public String getSslPassword() {
         return (String) connector.getAttribute("SSLPassword");
     }
-    
+
     @Persistent(manageable=false)
     public void setPollTime(int pollTime) {
         connector.setAttribute("pollTime", pollTime);
     }
-    
+
     @Persistent(manageable=false)
     public void setPollerSize(int pollerSize) {
         connector.setAttribute("pollerSize", pollerSize);
     }
-    
+
     @Persistent(manageable=false)
     public void setSendfileSize(int sendfileSize) {
         connector.setAttribute("sendfileSize", sendfileSize);
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCACertificateFile(String sslCACertificateFile) {
         if (sslCACertificateFile != null && sslCACertificateFile.equals(""))
             sslCACertificateFile = null;
         caCertificateFile = sslCACertificateFile;
-        
+
         if (caCertificateFile == null) {
             connector.setAttribute("SSLCACertificateFile", null);
         } else {
@@ -169,13 +169,13 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCACertificatePath(String sslCACertificatePath) {
         if (sslCACertificatePath != null && sslCACertificatePath.equals(""))
             sslCACertificatePath = null;
         caCertificatePath = sslCACertificatePath;
-        
+
         if (caCertificatePath == null) {
             connector.setAttribute("SSLCACertificatePath", null);
         } else {
@@ -187,13 +187,13 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCertificateChainFile(String sslCertificateChainFile) {
         if (sslCertificateChainFile != null && sslCertificateChainFile.equals(""))
             sslCertificateChainFile = null;
         certificateChainFile = sslCertificateChainFile;
-        
+
         if (certificateChainFile == null) {
             connector.setAttribute("SSLCertificateChainFile", null);
         } else {
@@ -205,13 +205,13 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCertificateFile(String sslCertificateFile) {
         if (sslCertificateFile != null && sslCertificateFile.equals(""))
             sslCertificateFile = null;
         certificateFile = sslCertificateFile;
-        
+
         if (certificateFile == null) {
             connector.setAttribute("SSLCertificateFile", null);
         } else {
@@ -223,13 +223,13 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCertificateKeyFile(String sslCertificateKeyFile) {
         if (sslCertificateKeyFile != null && sslCertificateKeyFile.equals(""))
             sslCertificateKeyFile = null;
         certificateKeyFile = sslCertificateKeyFile;
-        
+
         if (certificateKeyFile == null) {
             connector.setAttribute("SSLCertificateKeyFile", null);
         } else {
@@ -241,30 +241,30 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCipherSuite(String sslCipherSuite) {
         connector.setAttribute("SSLCipherSuite", sslCipherSuite);
     }
-    
+
     @Persistent(manageable=false)
     public void setSslPassword(String sslPassword) {
         if (sslPassword != null && sslPassword.equals(""))
             sslPassword = null;
         connector.setAttribute("SSLPassword", sslPassword);
     }
-    
+
     @Persistent(manageable=false)
     public void setSslProtocol(String sslProtocol) {
         connector.setAttribute("SSLProtocol", sslProtocol);
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCARevocationFile(String sslCARevocationFile) {
-        if (sslCARevocationFile!= null && sslCARevocationFile.equals("")) 
+        if (sslCARevocationFile!= null && sslCARevocationFile.equals(""))
             sslCARevocationFile = null;
         revocationFile = sslCARevocationFile;
-        
+
         if (revocationFile == null) {
             connector.setAttribute("SSLCARevocationFile", null);
         } else {
@@ -276,13 +276,13 @@ public class Http11APRConnectorGBean ext
 
         }
     }
-    
+
     @Persistent(manageable=false)
     public void setSslCARevocationPath(String sslCARevocationPath) {
-        if (sslCARevocationPath!= null && sslCARevocationPath.equals("")) 
+        if (sslCARevocationPath!= null && sslCARevocationPath.equals(""))
             sslCARevocationPath = null;
         revocationPath = sslCARevocationPath;
-        
+
         if (revocationPath == null) {
             connector.setAttribute("SSLCARevocationPath", null);
         } else {
@@ -295,20 +295,20 @@ public class Http11APRConnectorGBean ext
         }
 
     }
-    
+
     @Persistent(manageable=false)
     public void setSslVerifyClient(String sslVerifyClient) {
         connector.setAttribute("SSLVerifyClient", sslVerifyClient);
     }
-    
+
     @Persistent(manageable=false)
     public void setSslVerifyDepth(int sslVerifyDepth) {
         connector.setAttribute("SSLVerifyDepth", sslVerifyDepth);
     }
-    
+
     @Persistent(manageable=false)
     public void setUseSendfile(boolean useSendfile) {
         connector.setAttribute("useSendfile", useSendfile);
     }
-    
+
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11NIOConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11NIOConnectorGBean.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11NIOConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/Http11NIOConnectorGBean.java Wed Jun 16 11:43:51 2010
@@ -39,14 +39,14 @@ public class Http11NIOConnectorGBean ext
                                    @ParamReference(name = "TomcatContainer") TomcatContainer container,
                                    @ParamReference(name = "ServerInfo") ServerInfo serverInfo,
                                    @ParamAttribute(manageable=false, name = "connector") Connector conn)  throws Exception {
-                                   
+
         super(name, initParams, "org.apache.coyote.http11.Http11NioProtocol", host, port, container, serverInfo, conn);
     }
-    
+
     public int getDefaultPort() {
-        return 80; 
-    }  
-    
+        return 80;
+    }
+
     public String getGeronimoProtocol(){
         return WebManager.PROTOCOL_HTTP;
     }
@@ -63,7 +63,7 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getCommand_line_options() {
         Object value = connector.getAttribute("command-line-options");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public int getOomParachute() {
@@ -75,7 +75,7 @@ public class Http11NIOConnectorGBean ext
         Object value = connector.getAttribute("pollerThreadCount");
         return value == null ? 1 : Integer.parseInt(value.toString());
     }
-    
+
     public int getPollerThreadPriority() {
         Object value = connector.getAttribute("pollerThreadCount");
         return value == null ? Thread.NORM_PRIORITY : Integer.parseInt(value.toString());
@@ -123,7 +123,7 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getSocket_directBuffer() {
         Object value = connector.getAttribute("socket.directBuffer");
-        return value == null ? false : new Boolean(value.toString()).booleanValue();
+        return value == null ? false : Boolean.valueOf(value.toString());
     }
 
     public int getSocket_eventCache() {
@@ -138,7 +138,7 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getSocket_ooBInline() {
         Object value = connector.getAttribute("socket.ooBInline");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public int getSocket_performanceBandwidth() {
@@ -168,12 +168,12 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getSocket_soKeepAlive() {
         Object value = connector.getAttribute("socket.soKeepAlive");
-        return value == null ? false : new Boolean(value.toString()).booleanValue();
+        return value == null ? false : Boolean.valueOf(value.toString());
     }
 
     public boolean getSocket_soLingerOn() {
         Object value = connector.getAttribute("socket.soLingerOn");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public int getSocket_soLingerTime() {
@@ -183,7 +183,7 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getSocket_soReuseAddress() {
         Object value = connector.getAttribute("socket.soReuseAddress");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public int getSocket_soTimeout() {
@@ -198,7 +198,7 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getSocket_tcpNoDelay() {
         Object value = connector.getAttribute("socket.tcpNoDelay");
-        return value == null ? false : new Boolean(value.toString()).booleanValue();
+        return value == null ? false : Boolean.valueOf(value.toString());
     }
 
     public int getSocket_txBufSize() {
@@ -208,188 +208,188 @@ public class Http11NIOConnectorGBean ext
 
     public boolean getUseComet() {
         Object value = connector.getAttribute("useComet");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public boolean getUseExecutor() {
         Object value = connector.getAttribute("useExecutor");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
 
     public boolean getUseSendfile() {
         Object value = connector.getAttribute("useSendfile");
-        return value == null ? true : new Boolean(value.toString()).booleanValue();
+        return value == null ? true : Boolean.valueOf(value.toString());
     }
-    
+
     @Persistent(manageable=false)
     public void setAcceptorThreadCount(int acceptorThreadCount) {
-        connector.setAttribute("acceptorThreadCount", new Integer(acceptorThreadCount));
+        connector.setAttribute("acceptorThreadCount", Integer.valueOf(acceptorThreadCount));
     }
-    
+
     @Persistent(manageable=false)
     public void setAcceptorThreadPriority(int acceptorThreadPriority) {
-        connector.setAttribute("acceptorThreadPriority", new Integer(acceptorThreadPriority));
+        connector.setAttribute("acceptorThreadPriority", Integer.valueOf(acceptorThreadPriority));
     }
-    
+
     @Persistent(manageable=false)
     public void setCommand_line_options(boolean command_line_options) {
-        connector.setAttribute("command-line-options", new Boolean(command_line_options));
+        connector.setAttribute("command-line-options", Boolean.valueOf(command_line_options));
     }
-    
+
     @Persistent(manageable=false)
     public void setOomParachute(int oomParachute) {
-        connector.setAttribute("oomParachute", new Integer(oomParachute));
+        connector.setAttribute("oomParachute", Integer.valueOf(oomParachute));
     }
-    
+
     @Persistent(manageable=false)
     public void setPollerThreadCount(int pollerThreadCount) {
-        connector.setAttribute("pollerThreadCount", new Integer(pollerThreadCount));
+        connector.setAttribute("pollerThreadCount", Integer.valueOf(pollerThreadCount));
     }
-    
-    @Persistent(manageable=false)   
+
+    @Persistent(manageable=false)
     public void setPollerThreadPriority(int pollerThreadPriority) {
-        connector.setAttribute("pollerThreadPriority", new Integer(pollerThreadPriority));
+        connector.setAttribute("pollerThreadPriority", Integer.valueOf(pollerThreadPriority));
     }
-    
+
     @Persistent(manageable=false)
     public void setProcessCache(int processCache) {
-        connector.setAttribute("processCache", new Integer(processCache));
+        connector.setAttribute("processCache", Integer.valueOf(processCache));
     }
-    
+
     @Persistent(manageable=false)
     public void setSelectorPool_maxSelectors(int selectorPool_maxSelectors) {
-        connector.setAttribute("selectorPool.maxSelectors", new Integer(selectorPool_maxSelectors));
+        connector.setAttribute("selectorPool.maxSelectors", Integer.valueOf(selectorPool_maxSelectors));
     }
-    
+
     @Persistent(manageable=false)
     public void setSelectorPool_maxSpareSelectors(int selectorPool_maxSpareSelectors) {
-        connector.setAttribute("selectorPool.maxSpareSelectors", new Integer(selectorPool_maxSpareSelectors));
+        connector.setAttribute("selectorPool.maxSpareSelectors", Integer.valueOf(selectorPool_maxSpareSelectors));
     }
-    
+
     @Persistent(manageable=false)
     public void setSelectorTimeout(int selectorTimeout) {
-        connector.setAttribute("selectorTimeout", new Integer(selectorTimeout));
+        connector.setAttribute("selectorTimeout", Integer.valueOf(selectorTimeout));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_appReadBufSize(int socket_appReadBufSize) {
-        connector.setAttribute("socket.appReadBufSize", new Integer(socket_appReadBufSize));
+        connector.setAttribute("socket.appReadBufSize", Integer.valueOf(socket_appReadBufSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_appWriteBufSize(int socket_appWriteBufSize) {
-        connector.setAttribute("socket.appWriteBufSize", new Integer(socket_appWriteBufSize));
+        connector.setAttribute("socket.appWriteBufSize", Integer.valueOf(socket_appWriteBufSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_bufferPool(int socket_bufferPool) {
-        connector.setAttribute("socket.bufferPool", new Integer(socket_bufferPool));
+        connector.setAttribute("socket.bufferPool", Integer.valueOf(socket_bufferPool));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_bufferPoolSize(int socket_bufferPoolSize) {
-        connector.setAttribute("socket.bufferPoolSize", new Integer(socket_bufferPoolSize));
+        connector.setAttribute("socket.bufferPoolSize", Integer.valueOf(socket_bufferPoolSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_directBuffer(boolean socket_directBuffer) {
-        connector.setAttribute("socket.directBuffer", new Boolean(socket_directBuffer));
+        connector.setAttribute("socket.directBuffer", Boolean.valueOf(socket_directBuffer));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_eventCache(int socket_eventCache) {
-        connector.setAttribute("socket.eventCache", new Integer(socket_eventCache));
+        connector.setAttribute("socket.eventCache", Integer.valueOf(socket_eventCache));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_keyCache(int socket_keyCache) {
-        connector.setAttribute("socket.keyCache", new Integer(socket_keyCache));
+        connector.setAttribute("socket.keyCache", Integer.valueOf(socket_keyCache));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_ooBInline(boolean socket_ooBInline) {
-        connector.setAttribute("socket.ooBInline", new Boolean(socket_ooBInline));
+        connector.setAttribute("socket.ooBInline", Boolean.valueOf(socket_ooBInline));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_performanceBandwidth(int socket_performanceBandwidth) {
-        connector.setAttribute("socket.performanceBandwidth", new Integer(socket_performanceBandwidth));
+        connector.setAttribute("socket.performanceBandwidth", Integer.valueOf(socket_performanceBandwidth));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_performanceConnectionTime(int socket_performanceConnectionTime) {
-        connector.setAttribute("socket.performanceConnectionTime", new Integer(socket_performanceConnectionTime));
+        connector.setAttribute("socket.performanceConnectionTime", Integer.valueOf(socket_performanceConnectionTime));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_performanceLatency(int socket_performanceLatency) {
-        connector.setAttribute("socket.performanceLatency", new Integer(socket_performanceLatency));
+        connector.setAttribute("socket.performanceLatency", Integer.valueOf(socket_performanceLatency));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_processorCache(int socket_processorCache) {
-        connector.setAttribute("socket.processorCache", new Integer(socket_processorCache));
+        connector.setAttribute("socket.processorCache", Integer.valueOf(socket_processorCache));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_rxBufSize(int socket_rxBufSize) {
-        connector.setAttribute("socket.rxBufSize", new Integer(socket_rxBufSize));
+        connector.setAttribute("socket.rxBufSize", Integer.valueOf(socket_rxBufSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soKeepAlive(boolean socket_soKeepAlive) {
-        connector.setAttribute("socket.soKeepAlive", new Boolean(socket_soKeepAlive));
+        connector.setAttribute("socket.soKeepAlive", Boolean.valueOf(socket_soKeepAlive));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soLingerOn(boolean socket_soLingerOn) {
-        connector.setAttribute("socket.soLingerOn", new Boolean(socket_soLingerOn));
+        connector.setAttribute("socket.soLingerOn", Boolean.valueOf(socket_soLingerOn));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soLingerTime(int socket_soLingerTime) {
-        connector.setAttribute("socket.soLingerTime", new Integer(socket_soLingerTime));
+        connector.setAttribute("socket.soLingerTime", Integer.valueOf(socket_soLingerTime));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soReuseAddress(boolean socket_soReuseAddress) {
-        connector.setAttribute("socket.soReuseAddress", new Boolean(socket_soReuseAddress));
+        connector.setAttribute("socket.soReuseAddress", Boolean.valueOf(socket_soReuseAddress));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soTimeout(int socket_soTimeout) {
-        connector.setAttribute("socket.soTimeout", new Integer(socket_soTimeout));
+        connector.setAttribute("socket.soTimeout", Integer.valueOf(socket_soTimeout));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_soTrafficClass(int socket_soTrafficClass) {
-        connector.setAttribute("socket.soTrafficClass", new Integer(socket_soTrafficClass));
+        connector.setAttribute("socket.soTrafficClass", Integer.valueOf(socket_soTrafficClass));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_tcpNoDelay(boolean socket_tcpNoDelay) {
-        connector.setAttribute("socket.tcpNoDelay", new Boolean(socket_tcpNoDelay));
+        connector.setAttribute("socket.tcpNoDelay", Boolean.valueOf(socket_tcpNoDelay));
     }
-    
+
     @Persistent(manageable=false)
     public void setSocket_txBufSize(int socket_txBufSize) {
-        connector.setAttribute("socket.txBufSize", new Integer(socket_txBufSize));
+        connector.setAttribute("socket.txBufSize", Integer.valueOf(socket_txBufSize));
     }
-    
+
     @Persistent(manageable=false)
     public void setUseComet(boolean useComet) {
-        connector.setAttribute("useExecutor", new Boolean(useComet));
+        connector.setAttribute("useExecutor", Boolean.valueOf(useComet));
     }
-    
+
     @Persistent(manageable=false)
     public void setUseExecutor(boolean useExecutor) {
-        connector.setAttribute("useExecutor", new Boolean(useExecutor));
+        connector.setAttribute("useExecutor", Boolean.valueOf(useExecutor));
     }
-    
+
     @Persistent(manageable=false)
     public void setUseSendfile(boolean useSendfile) {
-        connector.setAttribute("useSendfile", new Boolean(useSendfile));
+        connector.setAttribute("useSendfile", Boolean.valueOf(useSendfile));
     }
-    
+
 
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicAuthenticator.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicAuthenticator.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/security/authentication/jaspic/JaspicAuthenticator.java Wed Jun 16 11:43:51 2010
@@ -20,28 +20,29 @@
 
 package org.apache.geronimo.tomcat.security.authentication.jaspic;
 
+import java.security.Principal;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
-import java.util.Arrays;
-import java.security.Principal;
 
-import javax.security.auth.message.config.ServerAuthContext;
-import javax.security.auth.message.config.ServerAuthConfig;
-import javax.security.auth.message.MessageInfo;
-import javax.security.auth.message.AuthStatus;
+import javax.security.auth.Subject;
 import javax.security.auth.message.AuthException;
+import javax.security.auth.message.AuthStatus;
+import javax.security.auth.message.MessageInfo;
 import javax.security.auth.message.callback.CallerPrincipalCallback;
 import javax.security.auth.message.callback.GroupPrincipalCallback;
-import javax.security.auth.Subject;
+import javax.security.auth.message.config.ServerAuthConfig;
+import javax.security.auth.message.config.ServerAuthContext;
 
-import org.apache.geronimo.tomcat.security.Authenticator;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
 import org.apache.geronimo.tomcat.security.AuthResult;
+import org.apache.geronimo.tomcat.security.Authenticator;
+import org.apache.geronimo.tomcat.security.IdentityService;
 import org.apache.geronimo.tomcat.security.ServerAuthException;
 import org.apache.geronimo.tomcat.security.TomcatAuthStatus;
 import org.apache.geronimo.tomcat.security.UserIdentity;
-import org.apache.geronimo.tomcat.security.IdentityService;
-import org.apache.catalina.connector.Request;
-import org.apache.catalina.connector.Response;
 
 /**
  * @version $Rev$ $Date$
@@ -102,7 +103,7 @@ public class JaspicAuthenticator impleme
                     }
                     GroupPrincipalCallback groupPrincipalCallback = callbackHandler.getThreadGroupPrincipalCallback();
                     String[] groups = groupPrincipalCallback == null ? null : groupPrincipalCallback.getGroups();
-                    userIdentity = identityService.newUserIdentity(clientSubject, principal, Arrays.asList(groups));
+                    userIdentity = identityService.newUserIdentity(clientSubject, principal, groups == null ? Collections.<String>emptyList() : Arrays.asList(groups));
                 }
                 return new AuthResult(TomcatAuthStatus.SUCCESS, userIdentity);
             }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ApplicationTest.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ApplicationTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ApplicationTest.java Wed Jun 16 11:43:51 2010
@@ -28,7 +28,7 @@ import java.net.URL;
  */
 public class ApplicationTest extends AbstractWebModuleTest {
     private File basedir = new File(System.getProperty("basedir"));
-    
+
     public void testApplication() throws Exception {
         setUpInsecureAppContext("war1",
                 null,
@@ -38,10 +38,20 @@ public class ApplicationTest extends Abs
                 null);
 
         HttpURLConnection connection = (HttpURLConnection) new URL(connector.getConnectUrl() +  "/test/hello.txt").openConnection();
-        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
-        assertEquals("Hello World", reader.readLine());
-        connection.disconnect();
+        BufferedReader reader = null;
+        try {
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+            assertEquals("Hello World", reader.readLine());
+        } finally {
+            connection.disconnect();
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (Exception e) {
+                }
+
+        }
     }
 
     protected void setUp() throws Exception {

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ContainerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ContainerTest.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ContainerTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/ContainerTest.java Wed Jun 16 11:43:51 2010
@@ -37,12 +37,18 @@ public class ContainerTest extends Abstr
         MockWebServiceContainer webServiceInvoker = new MockWebServiceContainer();
         container.addWebService(contextPath, null, webServiceInvoker, null, null, null, null, null, cl);
         HttpURLConnection connection = (HttpURLConnection) new URL(connector.getConnectUrl() + contextPath).openConnection();
+        BufferedReader reader = null;
         try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
             assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
             assertEquals("Hello World", reader.readLine());
         } finally {
             connection.disconnect();
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (Exception e) {
+                }
         }
         container.removeWebService(contextPath);
         connection = (HttpURLConnection) new URL(connector.getConnectUrl() + contextPath).openConnection();
@@ -79,11 +85,17 @@ public class ContainerTest extends Abstr
         connection = (HttpURLConnection) new URL(connector.getConnectUrl() + contextPath).openConnection();
         String authentication = new String(Base64.encode("alan:starcraft".getBytes()));
         connection.setRequestProperty("Authorization", "Basic " + authentication);
+        BufferedReader reader = null;
         try {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
             assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
             assertEquals("Hello World", reader.readLine());
         } finally {
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (Exception e) {
+                }
             connection.disconnect();
         }
         container.removeWebService(contextPath);

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/JAASSecurityTest.java Wed Jun 16 11:43:51 2010
@@ -119,9 +119,18 @@ public class JAASSecurityTest extends Ab
         assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
 
         //Be sure we have been given the login page
-        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
-        assertEquals("<!-- Login Page -->", reader.readLine());
-        reader.close();
+        BufferedReader reader = null;
+        try {
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            assertEquals("<!-- Login Page -->", reader.readLine());
+        } finally {
+            if (reader != null)
+                try {
+                    reader.close();
+                    reader = null;
+                } catch (Exception e) {
+                }
+        }
 
         String cookie = connection.getHeaderField("Set-Cookie");
         cookie = cookie.substring(0, cookie.lastIndexOf(';'));
@@ -137,10 +146,18 @@ public class JAASSecurityTest extends Ab
         connection = (HttpURLConnection) new URL(connector.getConnectUrl() + "/test/protected/hello.txt").openConnection();
         connection.setRequestProperty("Cookie", cookie);
         connection.setInstanceFollowRedirects(false);
-        reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+        try {
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
 
-        assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
-        assertEquals("Hello World", reader.readLine());
+            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+            assertEquals("Hello World", reader.readLine());
+        } finally {
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (Exception e) {
+                }
+        }
         connection.disconnect();
 
         stopWebApp();

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/StatTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/StatTest.java?rev=955206&r1=955205&r2=955206&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/StatTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/StatTest.java Wed Jun 16 11:43:51 2010
@@ -17,12 +17,10 @@
 package org.apache.geronimo.tomcat;
 
 import java.io.BufferedReader;
-import java.io.File;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
 import java.net.URL;
 
-import javax.management.ObjectName;
 import javax.management.j2ee.statistics.Statistic;
 import javax.management.j2ee.statistics.Stats;
 
@@ -31,18 +29,27 @@ import javax.management.j2ee.statistics.
  */
 public class StatTest extends AbstractWebModuleTest {
 
-    private ObjectName webModuleName;
+    //private ObjectName webModuleName;
 
     public void testStats() throws Exception {
         TomcatWebAppContext webModule;
         webModule = setUpInsecureAppContext("war1", null, null, null, null, null);
             HttpURLConnection connection = (HttpURLConnection) new URL(connector.getConnectUrl() + "/test/hello.txt")
                     .openConnection();
-            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            BufferedReader reader = null;
+        try {
+            reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
             assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
             assertEquals("Hello World", reader.readLine());
             //connection.disconnect();
-        // Stats stats = (Stats) kernel.getAttribute(webModuleName, "stats");
+            // Stats stats = (Stats) kernel.getAttribute(webModuleName, "stats");
+        } finally {
+            if (reader != null)
+                try {
+                    reader.close();
+                } catch (Exception e) {
+                }
+        }
 
         int n = 3;
         for (int k = 0; k < n; k++) {
@@ -50,7 +57,7 @@ public class StatTest extends AbstractWe
                 connector.resetStats();
                 webModule.resetStats();
             }
-            //System.out.println("******* NOW IS " + System.currentTimeMillis()); 
+            //System.out.println("******* NOW IS " + System.currentTimeMillis());
             Stats[] allStats = { webModule.getStats(), connector.getStats() };
             Stats stats;
             for (int j = 0; j < allStats.length; j++) {



Mime
View raw message