tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1041511 - in /tomcat/trunk: java/javax/servlet/ java/org/apache/catalina/ant/jmx/ java/org/apache/catalina/authenticator/ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/ha/backend/ java/org/apac...
Date Thu, 02 Dec 2010 18:17:57 GMT
Author: markt
Date: Thu Dec  2 18:17:55 2010
New Revision: 1041511

URL: http://svn.apache.org/viewvc?rev=1041511&view=rev
Log:
Replace use of inefficient constructors
Reported by FindBugs. Not all fixed.

Modified:
    tomcat/trunk/java/javax/servlet/ServletOutputStream.java
    tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
    tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
    tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
    tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
    tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java
    tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java
    tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java
    tomcat/trunk/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
    tomcat/trunk/java/org/apache/catalina/ha/tcp/ReplicationValve.java
    tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
    tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
    tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
    tomcat/trunk/java/org/apache/catalina/startup/Embedded.java
    tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java
    tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java
    tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
    tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/java/org/apache/jasper/compiler/Node.java
    tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
    tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
    tomcat/trunk/java/org/apache/naming/factory/BeanFactory.java
    tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
    tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
    tomcat/trunk/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java
    tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java
    tomcat/trunk/test/org/apache/catalina/tribes/test/NioSenderTest.java
    tomcat/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/javax/servlet/ServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletOutputStream.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletOutputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletOutputStream.java Thu Dec  2 18:17:55 2010
@@ -72,7 +72,7 @@ public abstract class ServletOutputStrea
             if ((c & 0xff00) != 0) { // high order byte must be zero
                 String errMsg = lStrings.getString("err.not_iso8859_1");
                 Object[] errArgs = new Object[1];
-                errArgs[0] = new Character(c);
+                errArgs[0] = Character.valueOf(c);
                 errMsg = MessageFormat.format(errMsg, errArgs);
                 throw new CharConversionException(errMsg);
             }

Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java Thu Dec  2 18:17:55 2010
@@ -535,7 +535,7 @@ public class JMXAccessorTask extends Bas
             }
         } else if ("java.lang.Boolean".equals(valueType)
                 || "boolean".equals(valueType)) {
-            convertValue = new Boolean(value);
+            convertValue = Boolean.valueOf(value);
         } else if ("java.lang.Float".equals(valueType)
                 || "float".equals(valueType)) {
             try {

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/DigestAuthenticator.java Thu Dec  2 18:17:55 2010
@@ -343,7 +343,7 @@ public class DigestAuthenticator
         } else if (quotedString.length() > 2) {
             return quotedString.substring(1, quotedString.length() - 1);
         } else {
-            return new String();
+            return "";
         }
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CometEventImpl.java Thu Dec  2 18:17:55 2010
@@ -117,7 +117,7 @@ public class CometEventImpl implements C
     public void setTimeout(int timeout) throws IOException, ServletException,
             UnsupportedOperationException {
         if (request.getAttribute("org.apache.tomcat.comet.timeout.support") == Boolean.TRUE) {
-            request.setAttribute("org.apache.tomcat.comet.timeout", new Integer(timeout));
+            request.setAttribute("org.apache.tomcat.comet.timeout", Integer.valueOf(timeout));
             if (request.isComet()) request.setCometTimeout(timeout);
         } else {
             throw new UnsupportedOperationException();

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteInputStream.java Thu Dec  2 18:17:55 2010
@@ -89,7 +89,7 @@ public class CoyoteInputStream
                         new PrivilegedExceptionAction<Integer>(){
 
                             public Integer run() throws IOException{
-                                Integer integer = new Integer(ib.readByte());
+                                Integer integer = Integer.valueOf(ib.readByte());
                                 return integer;
                             }
 
@@ -118,7 +118,7 @@ public class CoyoteInputStream
                         new PrivilegedExceptionAction<Integer>(){
 
                             public Integer run() throws IOException{
-                                Integer integer = new Integer(ib.available());
+                                Integer integer = Integer.valueOf(ib.available());
                                 return integer;
                             }
 
@@ -148,7 +148,7 @@ public class CoyoteInputStream
 
                             public Integer run() throws IOException{
                                 Integer integer = 
-                                    new Integer(ib.read(b, 0, b.length));
+                                    Integer.valueOf(ib.read(b, 0, b.length));
                                 return integer;
                             }
 
@@ -180,7 +180,7 @@ public class CoyoteInputStream
 
                             public Integer run() throws IOException{
                                 Integer integer = 
-                                    new Integer(ib.read(b, off, len));
+                                    Integer.valueOf(ib.read(b, off, len));
                                 return integer;
                             }
 

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Thu Dec  2 18:17:55 2010
@@ -2446,7 +2446,7 @@ public class Request
     }
     
     public void setCometTimeout(long timeout) {
-        coyoteRequest.action(ActionCode.COMET_SETTIMEOUT,new Long(timeout));
+        coyoteRequest.action(ActionCode.COMET_SETTIMEOUT, Long.valueOf(timeout));
     }
     
     /**

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Thu Dec  2 18:17:55 2010
@@ -1498,7 +1498,7 @@ public class Response
 
                 @Override
                 public Boolean run(){
-                    return new Boolean(doIsEncodeable(hreq, session, location));
+                    return Boolean.valueOf(doIsEncodeable(hreq, session, location));
                 }
             })).booleanValue();
         } else {

Modified: tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/NamingContextListener.java Thu Dec  2 18:17:55 2010
@@ -776,25 +776,25 @@ public class NamingContextListener
                 value = env.getValue();
             } else if (type.equals("java.lang.Byte")) {
                 if (env.getValue() == null) {
-                    value = new Byte((byte) 0);
+                    value = Byte.valueOf((byte) 0);
                 } else {
                     value = Byte.decode(env.getValue());
                 }
             } else if (type.equals("java.lang.Short")) {
                 if (env.getValue() == null) {
-                    value = new Short((short) 0);
+                    value = Short.valueOf((short) 0);
                 } else {
                     value = Short.decode(env.getValue());
                 }
             } else if (type.equals("java.lang.Integer")) {
                 if (env.getValue() == null) {
-                    value = new Integer(0);
+                    value = Integer.valueOf(0);
                 } else {
                     value = Integer.decode(env.getValue());
                 }
             } else if (type.equals("java.lang.Long")) {
                 if (env.getValue() == null) {
-                    value = new Long(0);
+                    value = Long.valueOf(0);
                 } else {
                     value = Long.decode(env.getValue());
                 }
@@ -802,22 +802,22 @@ public class NamingContextListener
                 value = Boolean.valueOf(env.getValue());
             } else if (type.equals("java.lang.Double")) {
                 if (env.getValue() == null) {
-                    value = new Double(0);
+                    value = Double.valueOf(0);
                 } else {
                     value = Double.valueOf(env.getValue());
                 }
             } else if (type.equals("java.lang.Float")) {
                 if (env.getValue() == null) {
-                    value = new Float(0);
+                    value = Float.valueOf(0);
                 } else {
                     value = Float.valueOf(env.getValue());
                 }
             } else if (type.equals("java.lang.Character")) {
                 if (env.getValue() == null) {
-                    value = new Character((char) 0);
+                    value = Character.valueOf((char) 0);
                 } else {
                     if (env.getValue().length() == 1) {
-                        value = new Character(env.getValue().charAt(0));
+                        value = Character.valueOf(env.getValue().charAt(0));
                     } else {
                         throw new IllegalArgumentException();
                     }

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Thu Dec  2 18:17:55 2010
@@ -364,7 +364,7 @@ final class StandardHostValve
         if (errorPage != null) {
             response.setAppCommitted(false);
             request.setAttribute(Globals.STATUS_CODE_ATTR,
-                              new Integer(statusCode));
+                              Integer.valueOf(statusCode));
 
             String message = response.getMessage();
             if (message == null)

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java Thu Dec  2 18:17:55 2010
@@ -323,8 +323,8 @@ public class StandardWrapper extends Con
             this.available = available;
         else
             this.available = 0L;
-        support.firePropertyChange("available", new Long(oldAvailable),
-                                   new Long(this.available));
+        support.firePropertyChange("available", Long.valueOf(oldAvailable),
+                                   Long.valueOf(this.available));
 
     }
 
@@ -396,8 +396,8 @@ public class StandardWrapper extends Con
         int oldLoadOnStartup = this.loadOnStartup;
         this.loadOnStartup = value;
         support.firePropertyChange("loadOnStartup",
-                                   new Integer(oldLoadOnStartup),
-                                   new Integer(this.loadOnStartup));
+                                   Integer.valueOf(oldLoadOnStartup),
+                                   Integer.valueOf(this.loadOnStartup));
 
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/backend/HeartbeatListener.java Thu Dec  2 18:17:55 2010
@@ -117,8 +117,8 @@ public class HeartbeatListener
                 coll = null;
                 return;
             }
-            String output = new String();
-            output = "v=1&ready=" + coll.ready + "&busy=" + coll.busy + "&port=" + port;
+            String output = "v=1&ready=" + coll.ready + "&busy=" + coll.busy +
+                    "&port=" + port;
             try {
                 sender.send(output);
             } catch (Exception ex) {

Modified: tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/deploy/FileMessageFactory.java Thu Dec  2 18:17:55 2010
@@ -243,7 +243,7 @@ public class FileMessageFactory {
         }
         
         FileMessage previous =
-            msgBuffer.put(new Long(msg.getMessageNumber()), msg);
+            msgBuffer.put(Long.valueOf(msg.getMessageNumber()), msg);
         if (previous !=null) {
             // Duplicate of message not yet processed
             log.warn("Receive Message again -- Sender ActTimeout too short [ path: "
@@ -259,7 +259,7 @@ public class FileMessageFactory {
         FileMessage next = null;
         synchronized (this) {
             if (!isWriting) {
-                next = msgBuffer.get(new Long(lastMessageProcessed.get() + 1));
+                next = msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 1));
                 if (next != null) {
                     isWriting = true;
                 } else {
@@ -281,7 +281,7 @@ public class FileMessageFactory {
             }
             synchronized(this) {
                 next =
-                    msgBuffer.get(new Long(lastMessageProcessed.get() + 1));
+                    msgBuffer.get(Long.valueOf(lastMessageProcessed.get() + 1));
                 if (next == null) {
                     isWriting = false;
                 }

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Thu Dec  2 18:17:55 2010
@@ -470,7 +470,8 @@ public CatalinaCluster getCluster() {
             sendCreateSession(session.getId(), session);
         }
         if (log.isDebugEnabled())
-            log.debug(sm.getString("deltaManager.createSession.newSession",session.getId(), new Integer(sessions.size())));
+            log.debug(sm.getString("deltaManager.createSession.newSession",
+                    session.getId(), Integer.valueOf(sessions.size())));
         return (session);
     }
 
@@ -705,7 +706,7 @@ public CatalinaCluster getCluster() {
         try {
             fos = new ByteArrayOutputStream();
             oos = new ObjectOutputStream(new BufferedOutputStream(fos));
-            oos.writeObject(new Integer(currentSessions.length));
+            oos.writeObject(Integer.valueOf(currentSessions.length));
             for(int i=0 ; i < currentSessions.length;i++) {
                 ((DeltaSession)currentSessions[i]).writeObjectData(oos);                
             }
@@ -923,10 +924,10 @@ public CatalinaCluster getCluster() {
         }
         if (isTimeout || (!getStateTransfered())) {
             counterNoStateTransfered++ ;
-            log.error(sm.getString("deltaManager.noSessionState",getName(),new Date(beforeSendTime),new Long(reqNow - beforeSendTime)));
+            log.error(sm.getString("deltaManager.noSessionState",getName(),new Date(beforeSendTime),Long.valueOf(reqNow - beforeSendTime)));
         } else {
             if (log.isInfoEnabled())
-                log.info(sm.getString("deltaManager.sessionReceived",getName(), new Date(beforeSendTime), new Long(reqNow - beforeSendTime)));
+                log.info(sm.getString("deltaManager.sessionReceived",getName(), new Date(beforeSendTime), Long.valueOf(reqNow - beforeSendTime)));
         }
     }
 
@@ -1303,7 +1304,7 @@ public CatalinaCluster getCluster() {
      */
     protected void handleALL_SESSION_TRANSFERCOMPLETE(SessionMessage msg, Member sender) {
         counterReceive_EVT_ALL_SESSION_TRANSFERCOMPLETE++ ;
-        if (log.isDebugEnabled()) log.debug(sm.getString("deltaManager.receiveMessage.transfercomplete",getName(), sender.getHost(), new Integer(sender.getPort())));
+        if (log.isDebugEnabled()) log.debug(sm.getString("deltaManager.receiveMessage.transfercomplete",getName(), sender.getHost(), Integer.valueOf(sender.getPort())));
         stateTransferCreateSendTime = msg.getTimestamp() ;
         stateTransfered = true ;
     }

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaRequest.java Thu Dec  2 18:17:55 2010
@@ -91,7 +91,7 @@ public class DeltaRequest implements Ext
 
     public void setMaxInactiveInterval(int interval) {
         int action = ACTION_SET;
-        addAction(TYPE_MAXINTERVAL,action,NAME_MAXINTERVAL,new Integer(interval));
+        addAction(TYPE_MAXINTERVAL,action,NAME_MAXINTERVAL,Integer.valueOf(interval));
     }
     
     /**
@@ -116,7 +116,7 @@ public class DeltaRequest implements Ext
 
     public void setNew(boolean n) {
         int action = ACTION_SET;
-        addAction(TYPE_ISNEW,action,NAME_ISNEW,new Boolean(n));
+        addAction(TYPE_ISNEW,action,NAME_ISNEW,Boolean.valueOf(n));
     }
 
     protected void addAction(int type,

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaSession.java Thu Dec  2 18:17:55 2010
@@ -428,7 +428,7 @@ public class DeltaSession extends Standa
             if (log.isDebugEnabled())
                 log.debug(sm.getString("deltaSession.notifying",
                                        ((ClusterManager)manager).getName(), 
-                                       new Boolean(isPrimarySession()), 
+                                       Boolean.valueOf(isPrimarySession()), 
                                        expiredId));
             if ( manager instanceof DeltaManager ) {
                 ( (DeltaManager) manager).sessionExpired(expiredId);
@@ -722,13 +722,13 @@ public class DeltaSession extends Standa
     
     private void writeObject(ObjectOutput stream) throws IOException {
         // Write the scalar instance variables (except Manager)
-        stream.writeObject(new Long(creationTime));
-        stream.writeObject(new Long(lastAccessedTime));
-        stream.writeObject(new Integer(maxInactiveInterval));
-        stream.writeObject(new Boolean(isNew));
-        stream.writeObject(new Boolean(isValid));
-        stream.writeObject(new Long(thisAccessedTime));
-        stream.writeObject(new Long(version));
+        stream.writeObject(Long.valueOf(creationTime));
+        stream.writeObject(Long.valueOf(lastAccessedTime));
+        stream.writeObject(Integer.valueOf(maxInactiveInterval));
+        stream.writeObject(Boolean.valueOf(isNew));
+        stream.writeObject(Boolean.valueOf(isValid));
+        stream.writeObject(Long.valueOf(thisAccessedTime));
+        stream.writeObject(Long.valueOf(version));
         stream.writeBoolean(getPrincipal() != null);
         if (getPrincipal() != null) {
             SerializablePrincipal.writePrincipal((GenericPrincipal) principal,stream);
@@ -754,7 +754,7 @@ public class DeltaSession extends Standa
 
         // Serialize the attribute count and the Serializable attributes
         int n = saveNames.size();
-        stream.writeObject(new Integer(n));
+        stream.writeObject(Integer.valueOf(n));
         for (int i = 0; i < n; i++) {
             stream.writeObject( saveNames.get(i));
             try {

Modified: tomcat/trunk/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/JvmRouteBinderValve.java Thu Dec  2 18:17:55 2010
@@ -238,7 +238,7 @@ public class JvmRouteBinderValve extends
             if (log.isDebugEnabled()) {
                 long t2 = System.currentTimeMillis();
                 long time = t2 - t1;
-                log.debug(sm.getString("jvmRoute.turnoverInfo", new Long(time)));
+                log.debug(sm.getString("jvmRoute.turnoverInfo", Long.valueOf(time)));
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/ha/tcp/ReplicationValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/tcp/ReplicationValve.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ha/tcp/ReplicationValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ha/tcp/ReplicationValve.java Thu Dec  2 18:17:55 2010
@@ -598,14 +598,14 @@ public class ReplicationValve
             if ( (nrOfRequests % 100) == 0 ) {
                  log.info(sm.getString("ReplicationValve.stats",
                      new Object[]{
-                         new Long(totalRequestTime/nrOfRequests),
-                         new Long(totalSendTime/nrOfRequests),
-                         new Long(nrOfRequests),
-                         new Long(nrOfSendRequests),
-                         new Long(nrOfCrossContextSendRequests),
-                         new Long(nrOfFilterRequests),
-                         new Long(totalRequestTime),
-                         new Long(totalSendTime)}));
+                         Long.valueOf(totalRequestTime/nrOfRequests),
+                         Long.valueOf(totalSendTime/nrOfRequests),
+                         Long.valueOf(nrOfRequests),
+                         Long.valueOf(nrOfSendRequests),
+                         Long.valueOf(nrOfCrossContextSendRequests),
+                         Long.valueOf(nrOfFilterRequests),
+                         Long.valueOf(totalRequestTime),
+                         Long.valueOf(totalSendTime)}));
              }
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java Thu Dec  2 18:17:55 2010
@@ -533,17 +533,17 @@ public final class HTMLManagerServlet ex
                 if (args[2] == null) {
                     args[2] = "&nbsp;";
                 }
-                args[3] = new Boolean(ctxt.getAvailable());
+                args[3] = Boolean.valueOf(ctxt.getAvailable());
                 args[4] = response.encodeURL(request.getContextPath() +
                      "/html/sessions?" + pathVersion);
                 Manager manager = ctxt.getManager(); 
                 if (manager instanceof DistributedManager && showProxySessions) {
-                    args[5] = new Integer(
+                    args[5] = Integer.valueOf(
                             ((DistributedManager)manager).getActiveSessionsFull());
                 } else if (ctxt.getManager() != null){
-                    args[5] = new Integer(manager.getActiveSessions());
+                    args[5] = Integer.valueOf(manager.getActiveSessions());
                 } else {
-                    args[5] = new Integer(0);
+                    args[5] = Integer.valueOf(0);
                 }
 
                 args[6] = highlightColor;
@@ -573,7 +573,7 @@ public final class HTMLManagerServlet ex
                     args[11] = smClient.getString(
                             "htmlManagerServlet.noManager");
                 } else {
-                    args[11] = new Integer(
+                    args[11] = Integer.valueOf(
                             ctxt.getManager().getMaxInactiveInterval()/60);
                 }
                 args[12] = smClient.getString("htmlManagerServlet.expire.unit");

Modified: tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java (original)
+++ tomcat/trunk/java/org/apache/catalina/manager/StatusTransformer.java Thu Dec  2 18:17:55 2010
@@ -168,20 +168,20 @@ public class StatusTransformer {
 
                 writer.print("<p>");
                 writer.print(" Physical memory: ");
-                writer.print(formatSize(new Long(result[0]), true));
+                writer.print(formatSize(Long.valueOf(result[0]), true));
                 writer.print(" Available memory: ");
-                writer.print(formatSize(new Long(result[1]), true));
+                writer.print(formatSize(Long.valueOf(result[1]), true));
                 writer.print(" Total page file: ");
-                writer.print(formatSize(new Long(result[2]), true));
+                writer.print(formatSize(Long.valueOf(result[2]), true));
                 writer.print(" Free page file: ");
-                writer.print(formatSize(new Long(result[3]), true));
+                writer.print(formatSize(Long.valueOf(result[3]), true));
                 writer.print(" Memory load: ");
-                writer.print(new Long(result[6]));
+                writer.print(Long.valueOf(result[6]));
                 writer.print("<br>");
                 writer.print(" Process kernel time: ");
-                writer.print(formatTime(new Long(result[11] / 1000), true));
+                writer.print(formatTime(Long.valueOf(result[11] / 1000), true));
                 writer.print(" Process user time: ");
-                writer.print(formatTime(new Long(result[12] / 1000), true));
+                writer.print(formatTime(Long.valueOf(result[12] / 1000), true));
                 writer.print("</p>");
             } else if (mode == 1){
                 // NO-OP
@@ -203,14 +203,14 @@ public class StatusTransformer {
 
             writer.print("<p>");
             writer.print(" Free memory: ");
-            writer.print(formatSize
-                         (new Long(Runtime.getRuntime().freeMemory()), true));
+            writer.print(formatSize(
+                    Long.valueOf(Runtime.getRuntime().freeMemory()), true));
             writer.print(" Total memory: ");
-            writer.print(formatSize
-                         (new Long(Runtime.getRuntime().totalMemory()), true));
+            writer.print(formatSize(
+                    Long.valueOf(Runtime.getRuntime().totalMemory()), true));
             writer.print(" Max memory: ");
-            writer.print(formatSize
-                         (new Long(Runtime.getRuntime().maxMemory()), true));
+            writer.print(formatSize(
+                    Long.valueOf(Runtime.getRuntime().maxMemory()), true));
             writer.print("</p>");
         } else if (mode == 1){
             writer.write("<jvm>");

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Thu Dec  2 18:17:55 2010
@@ -1616,11 +1616,11 @@ public class DefaultServlet
             && (response.getClass().getName().equals("org.apache.catalina.connector.ResponseFacade"))) {
             request.setAttribute("org.apache.tomcat.sendfile.filename", entry.attributes.getCanonicalPath());
             if (range == null) {
-                request.setAttribute("org.apache.tomcat.sendfile.start", new Long(0L));
-                request.setAttribute("org.apache.tomcat.sendfile.end", new Long(length));
+                request.setAttribute("org.apache.tomcat.sendfile.start", Long.valueOf(0L));
+                request.setAttribute("org.apache.tomcat.sendfile.end", Long.valueOf(length));
             } else {
-                request.setAttribute("org.apache.tomcat.sendfile.start", new Long(range.start));
-                request.setAttribute("org.apache.tomcat.sendfile.end", new Long(range.end + 1));
+                request.setAttribute("org.apache.tomcat.sendfile.start", Long.valueOf(range.start));
+                request.setAttribute("org.apache.tomcat.sendfile.end", Long.valueOf(range.end + 1));
             }
             request.setAttribute("org.apache.tomcat.sendfile.token", this);
             return true;

Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Thu Dec  2 18:17:55 2010
@@ -1123,7 +1123,7 @@ public class WebdavServlet
                 }
 
             } else {
-                lock.owner = new String();
+                lock.owner = "";
             }
 
         }
@@ -2064,9 +2064,8 @@ public class WebdavServlet
         }
 
         generatedXML.writeElement("D", "response", XMLWriter.OPENING);
-        String status = new String("HTTP/1.1 " + WebdavStatus.SC_OK + " "
-                                   + WebdavStatus.getStatusText
-                                   (WebdavStatus.SC_OK));
+        String status = "HTTP/1.1 " + WebdavStatus.SC_OK + " " +
+                WebdavStatus.getStatusText(WebdavStatus.SC_OK);
 
         // Generating href element
         generatedXML.writeElement("D", "href", XMLWriter.OPENING);
@@ -2293,9 +2292,8 @@ public class WebdavServlet
 
             if (propertiesNotFoundList.hasMoreElements()) {
 
-                status = new String("HTTP/1.1 " + WebdavStatus.SC_NOT_FOUND
-                                    + " " + WebdavStatus.getStatusText
-                                    (WebdavStatus.SC_NOT_FOUND));
+                status = "HTTP/1.1 " + WebdavStatus.SC_NOT_FOUND + " " +
+                        WebdavStatus.getStatusText(WebdavStatus.SC_NOT_FOUND);
 
                 generatedXML.writeElement("D", "propstat", XMLWriter.OPENING);
                 generatedXML.writeElement("D", "prop", XMLWriter.OPENING);
@@ -2349,9 +2347,8 @@ public class WebdavServlet
             return;
 
         generatedXML.writeElement("D", "response", XMLWriter.OPENING);
-        String status = new String("HTTP/1.1 " + WebdavStatus.SC_OK + " "
-                                   + WebdavStatus.getStatusText
-                                   (WebdavStatus.SC_OK));
+        String status = "HTTP/1.1 " + WebdavStatus.SC_OK + " " +
+                WebdavStatus.getStatusText(WebdavStatus.SC_OK);
 
         // Generating href element
         generatedXML.writeElement("D", "href", XMLWriter.OPENING);
@@ -2529,9 +2526,8 @@ public class WebdavServlet
 
             if (propertiesNotFoundList.hasMoreElements()) {
 
-                status = new String("HTTP/1.1 " + WebdavStatus.SC_NOT_FOUND
-                                    + " " + WebdavStatus.getStatusText
-                                    (WebdavStatus.SC_NOT_FOUND));
+                status = "HTTP/1.1 " + WebdavStatus.SC_NOT_FOUND + " " +
+                        WebdavStatus.getStatusText(WebdavStatus.SC_NOT_FOUND);
 
                 generatedXML.writeElement("D", "propstat", XMLWriter.OPENING);
                 generatedXML.writeElement("D", "prop", XMLWriter.OPENING);
@@ -3111,7 +3107,7 @@ class WebdavStatus {
      *                  HTTP status code (e.g., "OK").
      */
     public static String getStatusText(int nHttpStatusCode) {
-        Integer intKey = new Integer(nHttpStatusCode);
+        Integer intKey = Integer.valueOf(nHttpStatusCode);
 
         if (!mapStatusCodes.containsKey(intKey)) {
             return "";
@@ -3132,7 +3128,7 @@ class WebdavStatus {
      * @param   strVal  [IN] HTTP status text
      */
     private static void addStatusCodeMap(int nKey, String strVal) {
-        mapStatusCodes.put(new Integer(nKey), strVal);
+        mapStatusCodes.put(Integer.valueOf(nKey), strVal);
     }
 
 }

Modified: tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/session/PersistentManagerBase.java Thu Dec  2 18:17:55 2010
@@ -389,8 +389,8 @@ public abstract class PersistentManagerB
         boolean oldSaveOnRestart = this.saveOnRestart;
         this.saveOnRestart = saveOnRestart;
         support.firePropertyChange("saveOnRestart",
-                                   new Boolean(oldSaveOnRestart),
-                                   new Boolean(this.saveOnRestart));
+                                   Boolean.valueOf(oldSaveOnRestart),
+                                   Boolean.valueOf(this.saveOnRestart));
 
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/startup/Embedded.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Embedded.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/Embedded.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/Embedded.java Thu Dec  2 18:17:55 2010
@@ -220,8 +220,8 @@ public class Embedded  extends StandardS
 
         boolean oldUseNaming = this.useNaming;
         this.useNaming = useNaming;
-        support.firePropertyChange("useNaming", new Boolean(oldUseNaming),
-                                   new Boolean(this.useNaming));
+        support.firePropertyChange("useNaming", Boolean.valueOf(oldUseNaming),
+                                   Boolean.valueOf(this.useNaming));
 
     }
 
@@ -245,8 +245,9 @@ public class Embedded  extends StandardS
 
         boolean oldRedirectStreams = this.redirectStreams;
         this.redirectStreams = redirectStreams;
-        support.firePropertyChange("redirectStreams", new Boolean(oldRedirectStreams),
-                                   new Boolean(this.redirectStreams));
+        support.firePropertyChange("redirectStreams",
+                                   Boolean.valueOf(oldRedirectStreams),
+                                   Boolean.valueOf(this.redirectStreams));
 
     }
 

Modified: tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/membership/McastService.java Thu Dec  2 18:17:55 2010
@@ -257,7 +257,7 @@ public class McastService implements Mem
     public boolean getRecoveryEnabled() {
         String p = properties.getProperty("recoveryEnabled");
         if(p != null){
-            return new Boolean(p).booleanValue();
+            return Boolean.valueOf(p).booleanValue();
         }
         return false;
     }
@@ -281,7 +281,7 @@ public class McastService implements Mem
     public boolean getLocalLoopbackDisabled(boolean localLoopbackDisabled) {
         String p = properties.getProperty("localLoopbackDisabled");
         if(p != null){
-            return new Boolean(p).booleanValue();
+            return Boolean.valueOf(p).booleanValue();
         }
         return false;
     }

Modified: tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java Thu Dec  2 18:17:55 2010
@@ -412,7 +412,7 @@ public final class JDBCAccessLogValve ex
      * is desired or not.
      */
     public void setResolveHosts(String resolveHosts) {
-        this.resolveHosts = new Boolean(resolveHosts).booleanValue();
+        this.resolveHosts = Boolean.valueOf(resolveHosts).booleanValue();
     }
 
     /**

Modified: tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java Thu Dec  2 18:17:55 2010
@@ -72,7 +72,7 @@ public class SSLValve
         if (strcert0 != null && strcert0.length()>28) {
             String strcert1 = strcert0.replace(' ', '\n');
             String strcert2 = strcert1.substring(28, strcert1.length()-26);
-            String strcert3 = new String("-----BEGIN CERTIFICATE-----\n");
+            String strcert3 = "-----BEGIN CERTIFICATE-----\n";
             String strcert4 = strcert3.concat(strcert2);
             String strcerts = strcert4.concat("\n-----END CERTIFICATE-----\n");
             // ByteArrayInputStream bais = new ByteArrayInputStream(strcerts.getBytes("UTF-8"));

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Dumper.java Thu Dec  2 18:17:55 2010
@@ -171,7 +171,7 @@ class Dumper {
         
         @Override
         public void visit(Node.ELExpression n) throws JasperException {
-            printString( "${" + new String( n.getText() ) + "}" );
+            printString( "${" + n.getText() + "}" );
         }
 
         @Override
@@ -191,7 +191,7 @@ class Dumper {
 
         @Override
         public void visit(Node.TemplateText n) throws JasperException {
-            printString(new String(n.getText()));
+            printString(n.getText());
         }
 
         private void printIndent() {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Thu Dec  2 18:17:55 2010
@@ -229,7 +229,7 @@ class Generator {
             @Override
             public void visit(Node.Declaration n) throws JasperException {
                 n.setBeginJavaLine(out.getJavaLine());
-                out.printMultiLn(new String(n.getText()));
+                out.printMultiLn(n.getText());
                 out.println();
                 n.setEndJavaLine(out.getJavaLine());
             }
@@ -902,12 +902,12 @@ class Generator {
             n.setBeginJavaLine(out.getJavaLine());
             if (!pageInfo.isELIgnored() && (n.getEL() != null)) {
                 out.printil("out.write("
-                        + JspUtil.interpreterCall(this.isTagFile, n.getType() + "{"
-                                + new String(n.getText()) + "}", String.class,
+                        + JspUtil.interpreterCall(this.isTagFile, n.getType() +
+                                "{" + n.getText() + "}", String.class,
                                 n.getEL().getMapName(), false) + ");");
             } else {
                 out.printil("out.write("
-                        + quote(n.getType() + "{" + new String(n.getText()) + "}") + ");");
+                        + quote(n.getType() + "{" + n.getText() + "}") + ");");
             }
             n.setEndJavaLine(out.getJavaLine());
         }
@@ -3255,9 +3255,8 @@ class Generator {
                         out.printil("String "
                                 + varName
                                 + " = "
-                                + quote(new String(
-                                        ((Node.TemplateText) bodyElement)
-                                                .getText())) + ";");
+                                + quote(((Node.TemplateText) bodyElement)
+                                                .getText()) + ";");
                     }
                 }
 

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Node.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Node.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Node.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Node.java Thu Dec  2 18:17:55 2010
@@ -1961,7 +1961,7 @@ abstract class Node implements TagConsta
 
                 @Override
                 public void visit(TemplateText txt) {
-                    attrValue = new String(txt.getText());
+                    attrValue = txt.getText();
                 }
 
                 public String getAttrValue() {

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TextOptimizer.java Thu Dec  2 18:17:55 2010
@@ -33,7 +33,7 @@ public class TextOptimizer {
         private int textNodeCount = 0;
         private Node.TemplateText firstTextNode = null;
         private StringBuilder textBuffer;
-        private final String emptyText = new String("");
+        private final String emptyText = "";
 
         public TextCatVisitor(Compiler compiler) {
             options = compiler.getCompilationContext().getOptions();

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Thu Dec  2 18:17:55 2010
@@ -183,7 +183,7 @@ public class JspRuntimeLibrary {
             if (isNullOrEmpty) {
                 s = "false";
             }
-            return new Boolean(s);
+            return Boolean.valueOf(s);
         } else if (target == Byte.class) {
             if (isNullOrEmpty)
                 return new Byte((byte) 0);
@@ -244,7 +244,7 @@ public class JspRuntimeLibrary {
                     s = "true";
                 else
                     s = "false";
-                return new Boolean(s);
+                return Boolean.valueOf(s);
             } else if ( t.equals(Byte.class) || t.equals(Byte.TYPE) ) {
                 return new Byte(s);
             } else if (t.equals(Character.class) || t.equals(Character.TYPE)) {
@@ -389,7 +389,7 @@ public class JspRuntimeLibrary {
     }
 
     public static String toString(boolean b) {
-        return new Boolean(b).toString();
+        return Boolean.valueOf(b).toString();
     }
 
     public static String toString(short s) {
@@ -452,7 +452,7 @@ public class JspRuntimeLibrary {
             } else if (t.equals(Boolean.class)) {
                 Boolean[] tmpval = new Boolean[values.length];
                 for (int i = 0 ; i < values.length; i++)
-                    tmpval[i] = new Boolean (values[i]);
+                    tmpval[i] = Boolean.valueOf(values[i]);
                 method.invoke (bean, new Object[] {tmpval});
             } else if (t.equals(Short.class)) {
                 Short[] tmpval = new Short[values.length];
@@ -719,7 +719,7 @@ public class JspRuntimeLibrary {
     {
         try {
             Method method = getWriteMethod(bean.getClass(), prop);
-            method.invoke(bean, new Object[] { new Boolean(value) });
+            method.invoke(bean, new Object[] { Boolean.valueOf(value) });
         } catch (Exception ex) {
             throw new JasperException(ex);
         }        

Modified: tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java (original)
+++ tomcat/trunk/java/org/apache/jasper/xmlparser/XMLEncodingDetector.java Thu Dec  2 18:17:55 2010
@@ -327,11 +327,11 @@ public class XMLEncodingDetector {
         int b3 = b4[3] & 0xFF;
         if (b0 == 0x00 && b1 == 0x00 && b2 == 0x00 && b3 == 0x3C) {
             // UCS-4, big endian (1234)
-            return new Object [] {"ISO-10646-UCS-4", new Boolean(true), Integer.valueOf(4)};
+            return new Object [] {"ISO-10646-UCS-4", Boolean.TRUE, Integer.valueOf(4)};
         }
         if (b0 == 0x3C && b1 == 0x00 && b2 == 0x00 && b3 == 0x00) {
             // UCS-4, little endian (4321)
-            return new Object [] {"ISO-10646-UCS-4", new Boolean(false), Integer.valueOf(4)};
+            return new Object [] {"ISO-10646-UCS-4", Boolean.FALSE, Integer.valueOf(4)};
         }
         if (b0 == 0x00 && b1 == 0x00 && b2 == 0x3C && b3 == 0x00) {
             // UCS-4, unusual octet order (2143)
@@ -347,12 +347,12 @@ public class XMLEncodingDetector {
             // UTF-16, big-endian, no BOM
             // (or could turn out to be UCS-2...
             // REVISIT: What should this be?
-            return new Object [] {"UTF-16BE", new Boolean(true), Integer.valueOf(4)};
+            return new Object [] {"UTF-16BE", Boolean.TRUE, Integer.valueOf(4)};
         }
         if (b0 == 0x3C && b1 == 0x00 && b2 == 0x3F && b3 == 0x00) {
             // UTF-16, little-endian, no BOM
             // (or could turn out to be UCS-2...
-            return new Object [] {"UTF-16LE", new Boolean(false), Integer.valueOf(4)};
+            return new Object [] {"UTF-16LE", Boolean.FALSE, Integer.valueOf(4)};
         }
         if (b0 == 0x4C && b1 == 0x6F && b2 == 0xA7 && b3 == 0x94) {
             // EBCDIC

Modified: tomcat/trunk/java/org/apache/naming/factory/BeanFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/BeanFactory.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/BeanFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/BeanFactory.java Thu Dec  2 18:17:55 2010
@@ -190,7 +190,7 @@ public class BeanFactory
                                 valueArray[0] = new Double(value);
                             } else if (propType.equals(Boolean.class)
                                        || propType.equals(boolean.class)) {
-                                valueArray[0] = new Boolean(value);
+                                valueArray[0] = Boolean.valueOf(value);
                             } else {
                                 throw new NamingException
                                     ("String conversion for property type '"

Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Thu Dec  2 18:17:55 2010
@@ -314,7 +314,7 @@ public final class IntrospectionUtils {
                         // Try a setFoo ( boolean )
                     } else if ("java.lang.Boolean".equals(paramType.getName())
                             || "boolean".equals(paramType.getName())) {
-                        params[0] = new Boolean(value);
+                        params[0] = Boolean.valueOf(value);
 
                         // Try a setFoo ( InetAddress )
                     } else if ("java.net.InetAddress".equals(paramType
@@ -866,7 +866,7 @@ public final class IntrospectionUtils {
             // Try a setFoo ( boolean )
         } else if ("java.lang.Boolean".equals(paramType.getName())
                 || "boolean".equals(paramType.getName())) {
-            result = new Boolean(object);
+            result = Boolean.valueOf(object);
 
             // Try a setFoo ( InetAddress )
         } else if ("java.net.InetAddress".equals(paramType

Modified: tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/modeler/Registry.java Thu Dec  2 18:17:55 2010
@@ -637,7 +637,7 @@ public class Registry implements Registr
             objValue=new Long( value );
         } else if( "java.lang.Boolean".equals( type ) ||
                 "boolean".equals( type )) {
-            objValue=new Boolean( value );
+            objValue=Boolean.valueOf( value );
         }
         return objValue;
     }

Modified: tomcat/trunk/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java (original)
+++ tomcat/trunk/test/org/apache/catalina/tribes/demos/IntrospectionUtils.java Thu Dec  2 18:17:55 2010
@@ -311,7 +311,7 @@ public final class IntrospectionUtils {
                         // Try a setFoo ( boolean )
                     } else if ("java.lang.Boolean".equals(paramType.getName())
                             || "boolean".equals(paramType.getName())) {
-                        params[0] = new Boolean(value);
+                        params[0] = Boolean.valueOf(value);
 
                         // Try a setFoo ( InetAddress )
                     } else if ("java.net.InetAddress".equals(paramType
@@ -863,7 +863,7 @@ public final class IntrospectionUtils {
             // Try a setFoo ( boolean )
         } else if ("java.lang.Boolean".equals(paramType.getName())
                 || "boolean".equals(paramType.getName())) {
-            result = new Boolean(object);
+            result = Boolean.valueOf(object);
 
             // Try a setFoo ( InetAddress )
         } else if ("java.net.InetAddress".equals(paramType

Modified: tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java (original)
+++ tomcat/trunk/test/org/apache/catalina/tribes/demos/MapDemo.java Thu Dec  2 18:17:55 2010
@@ -260,9 +260,9 @@ public class MapDemo implements ChannelL
                     case 2: return entry.getValue();
                     case 3: return entry.getPrimary()!=null?entry.getPrimary().getName():"null";
                     case 4: return getMemberNames(entry.getBackupNodes());
-                    case 5: return new Boolean(entry.isPrimary());
-                    case 6: return new Boolean(entry.isProxy());
-                    case 7: return new Boolean(entry.isBackup());
+                    case 5: return Boolean.valueOf(entry.isPrimary());
+                    case 6: return Boolean.valueOf(entry.isProxy());
+                    case 7: return Boolean.valueOf(entry.isBackup());
                     default: return "";
                 }
                 

Modified: tomcat/trunk/test/org/apache/catalina/tribes/test/NioSenderTest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/test/NioSenderTest.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/tribes/test/NioSenderTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/tribes/test/NioSenderTest.java Thu Dec  2 18:17:55 2010
@@ -51,7 +51,7 @@ public class NioSenderTest {
     }
     
     public synchronized ChannelData getMessage(Member mbr) {
-        String msg = new String("Thread-"+Thread.currentThread().getName()+" Message:"+inc());
+        String msg = "Thread-"+Thread.currentThread().getName()+" Message:"+inc();
         ChannelData data = new ChannelData(true);
         data.setMessage(new XByteBuffer(msg.getBytes(),false));
         data.setAddress(mbr);

Modified: tomcat/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java (original)
+++ tomcat/trunk/test/org/apache/catalina/tribes/test/io/TestSenderConnections.java Thu Dec  2 18:17:55 2010
@@ -106,7 +106,7 @@ public class TestSenderConnections exten
             for (int i=0; i<size; i++ ) {
                 int length = Math.abs(r.nextInt() %65000);
                 ArrayList<Object> list = new ArrayList<Object>(length);
-                map.put(new Integer(i),list);
+                map.put(Integer.valueOf(i),list);
             }
         }
     }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1041511&r1=1041510&r2=1041511&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Dec  2 18:17:55 2010
@@ -90,6 +90,10 @@
       <fix>
         Don&apos;t use <code>null</code>s to construct log messages. (markt)
       </fix>
+      <fix>
+        Code clean-up. Replace use of inefficient constructors with more
+        efficient alternatives. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message