commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/exception ExceptionUtils.java
Date Fri, 25 Jul 2003 23:06:59 GMT
scolebourne    2003/07/25 16:06:59

  Modified:    lang/src/java/org/apache/commons/lang StringEscapeUtils.java
                        BooleanUtils.java
               lang/src/java/org/apache/commons/lang/math RandomUtils.java
               lang/src/java/org/apache/commons/lang/exception
                        ExceptionUtils.java
  Log:
  Change as recommended by findBugs
  (static variables private or final, and Boolean constructor optimisation)
  
  Revision  Changes    Path
  1.19      +4 -3      jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java
  
  Index: StringEscapeUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/StringEscapeUtils.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- StringEscapeUtils.java	20 Jul 2003 15:49:58 -0000	1.18
  +++ StringEscapeUtils.java	25 Jul 2003 23:06:58 -0000	1.19
  @@ -59,7 +59,8 @@
   import org.apache.commons.lang.exception.NestableRuntimeException;
   
   /**
  - * <p>Escapes and unescapes <code>String</code>s for Java, Java Script,
HTML, XML, and SQL.
  + * <p>Escapes and unescapes <code>String</code>s for
  + * Java, Java Script, HTML, XML, and SQL.</p>
    *
    * @author Apache Jakarta Turbine
    * @author GenerationJavaCore library
  @@ -78,7 +79,7 @@
       /**
        * The entity set to use when escaping and unescaping HTML.
        */
  -    protected static Entities DEFAULT_ENTITIES = Entities.HTML40;
  +    private static final Entities DEFAULT_ENTITIES = Entities.HTML40;
   
       /**
        * <p><code>StringEscapeUtils</code> instances should NOT be constructed
in
  
  
  
  1.9       +2 -2      jakarta-commons/lang/src/java/org/apache/commons/lang/BooleanUtils.java
  
  Index: BooleanUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/BooleanUtils.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- BooleanUtils.java	19 Jul 2003 20:17:12 -0000	1.8
  +++ BooleanUtils.java	25 Jul 2003 23:06:58 -0000	1.9
  @@ -659,7 +659,7 @@
        * @throws IllegalArgumentException if <code>array</code> is empty.
        */
       public static Boolean xor(Boolean[] array) {
  -        return new Boolean(xor(ArrayUtils.toPrimitive(array)));
  +        return (xor(ArrayUtils.toPrimitive(array)) ? Boolean.TRUE : Boolean.FALSE);
       }
   
   }
  
  
  
  1.4       +2 -2      jakarta-commons/lang/src/java/org/apache/commons/lang/math/RandomUtils.java
  
  Index: RandomUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/math/RandomUtils.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RandomUtils.java	14 Jul 2003 22:25:05 -0000	1.3
  +++ RandomUtils.java	25 Jul 2003 23:06:58 -0000	1.4
  @@ -66,7 +66,7 @@
    */
   public final class RandomUtils {
   
  -    public static Random JVM_RANDOM = new JVMRandom();
  +    public static final Random JVM_RANDOM = new JVMRandom();
   
   // should be possible for JVM_RANDOM?
   //    public static void nextBytes(byte[]) {
  
  
  
  1.27      +2 -2      jakarta-commons/lang/src/java/org/apache/commons/lang/exception/ExceptionUtils.java
  
  Index: ExceptionUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/exception/ExceptionUtils.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ExceptionUtils.java	20 Jul 2003 15:49:58 -0000	1.26
  +++ ExceptionUtils.java	25 Jul 2003 23:06:58 -0000	1.27
  @@ -95,7 +95,7 @@
        * <p>The names of methods commonly used to access a wrapped
        * exception.</p>
        */
  -    protected static String[] CAUSE_METHOD_NAMES = {
  +    private static String[] CAUSE_METHOD_NAMES = {
           "getCause",
           "getNextException",
           "getTargetException",
  
  
  

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


Mime
View raw message