axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ow...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/logging Tr.java
Date Thu, 18 Jul 2002 12:28:20 GMT
owenb       2002/07/18 05:28:20

  Modified:    java/src/org/apache/wsif/logging Tr.java
  Log:
  Fix for brief(String, Object[]) method to avoid a NullPointerException 
  when an object in the array is null.
  
  Revision  Changes    Path
  1.5       +11 -4     xml-axis-wsif/java/src/org/apache/wsif/logging/Tr.java
  
  Index: Tr.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/Tr.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Tr.java	4 Jul 2002 09:25:03 -0000	1.4
  +++ Tr.java	18 Jul 2002 12:28:20 -0000	1.5
  @@ -574,10 +574,17 @@
               if (objs.length == 0)
                   return name + ":size(0)";
               int i;
  -            String buff = "";
  -            for (i = 0; i < objs.length; i++)
  -                buff += " " + name + "[" + i + "]:" + objs[i].toString();
  -            return buff;
  +            StringBuffer buff = new StringBuffer("");
  +            for (i = 0; i < objs.length; i++) {
  +            	String s = (objs[i] == null) ? "null" : objs[i].toString();
  +                buff.append(" ");
  +                buff.append(name);
  +                buff.append("[");
  +                buff.append(i);
  +                buff.append("]:");
  +                buff.append(s);
  +            }
  +            return buff.toString();
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  
  
  

Mime
View raw message