james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgoldst...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/util/mordred PoolConnEntry.java
Date Wed, 07 Aug 2002 23:22:33 GMT
pgoldstein    2002/08/07 16:22:33

  Modified:    src/java/org/apache/james/util/mordred PoolConnEntry.java
  Log:
  Part of the String=>StringBuffer changes.  Includes some additional
  commenting, formatting fixes, and wrapping of logging calls in log
  level checks.  Also converted equalsIgnoreCase paradigm as discussed on
  mailing list.  Locale issue for both toUpperCase() and toLowerCase() was
  addressed as well.
  
  Revision  Changes    Path
  1.5       +19 -4     jakarta-james/src/java/org/apache/james/util/mordred/PoolConnEntry.java
  
  Index: PoolConnEntry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/util/mordred/PoolConnEntry.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PoolConnEntry.java	18 Apr 2002 14:13:53 -0000	1.4
  +++ PoolConnEntry.java	7 Aug 2002 23:22:33 -0000	1.5
  @@ -15,7 +15,7 @@
   /**
    * Insert the type's description here.
    * Creation date: (8/24/99 11:41:10 AM)
  - * @author: Serge Knystautas <sergek@lokitech.com>
  + * @author Serge Knystautas <sergek@lokitech.com>
    */
   public class PoolConnEntry implements java.sql.Connection{
       private static final boolean DEEP_DEBUG = false;
  @@ -105,7 +105,12 @@
           try {
               SQLWarning currSQLWarning = connection.getWarnings();
               while (currSQLWarning != null) {
  -                container.debug("Warnings on connection " + id + " " + currSQLWarning);
  +                StringBuffer logBuffer =
  +                    new StringBuffer(256)
  +                            .append("Warnings on connection ")
  +                            .append(id)
  +                            .append(currSQLWarning);
  +                container.debug(logBuffer.toString());
                   currSQLWarning = currSQLWarning.getNextWarning();
               }
               connection.clearWarnings();
  @@ -178,7 +183,12 @@
           try {
               connection.close();
           } catch (SQLException ex) {
  -            container.warn("Cannot close connection " + id + " on finalize");
  +            StringBuffer warnBuffer =
  +                new StringBuffer(64)
  +                    .append("Cannot close connection ")
  +                    .append(id)
  +                    .append(" on finalize");
  +            container.warn(warnBuffer.toString());
           }
           // Dump the stack trace of whoever created this connection
           if (getTrace() != null) {
  @@ -189,7 +199,12 @@
       }
   
       public String getString() {
  -        return getId() + ": " + connection.toString();
  +        StringBuffer poolConnStringBuffer =
  +            new StringBuffer(64)
  +                    .append(getId())
  +                    .append(": ")
  +                    .append(connection.toString());
  +        return poolConnStringBuffer.toString();
       }
   
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message