You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2008/03/01 01:21:59 UTC

svn commit: r632503 - /commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java

Author: ggregory
Date: Fri Feb 29 16:21:52 2008
New Revision: 632503

URL: http://svn.apache.org/viewvc?rev=632503&view=rev
Log:
Make formatting consistent across the file:
Replace "methodcall( expr )" with "methodcall(expr)".
Replace "type foo = (expr)" with "type foo = expr".
Replace "if(expr)" with "if (expr)"

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java?rev=632503&r1=632502&r2=632503&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java Fri Feb 29 16:21:52 2008
@@ -3229,7 +3229,7 @@
      * @since 2.1
      */
     public static Object[] add(Object[] array, Object element) {
-        Class type = (array != null ? array.getClass() : (element != null ? element.getClass() : Object.class));
+        Class type = array != null ? array.getClass() : (element != null ? element.getClass() : Object.class);
         Object[] newArray = (Object[]) copyArrayGrow1(array, type);
         newArray[newArray.length - 1] = element;
         return newArray;
@@ -3500,15 +3500,14 @@
      */
     public static Object[] add(Object[] array, int index, Object element) {
         Class clss = null;
-        if(array != null) {
+        if (array != null) {
             clss = array.getClass().getComponentType();
-        } else
-        if(element != null) {
+        } else if (element != null) {
             clss = element.getClass();
         } else {
-            return new Object[] { null };
+            return new Object[]{null};
         }
-        return (Object[]) add( array, index, element, clss );
+        return (Object[]) add(array, index, element, clss);
     }
     
     /**
@@ -3539,7 +3538,7 @@
      * (index < 0 || index > array.length).
      */
     public static boolean[] add(boolean[] array, int index, boolean element) {
-        return (boolean[]) add( array, index, BooleanUtils.toBooleanObject(element), Boolean.TYPE );
+        return (boolean[]) add(array, index, BooleanUtils.toBooleanObject(element), Boolean.TYPE);
     }
     
     /**
@@ -3571,7 +3570,7 @@
      * (index < 0 || index > array.length).
      */
     public static char[] add(char[] array, int index, char element) {
-        return (char[]) add( array, index, new Character(element), Character.TYPE );
+        return (char[]) add(array, index, new Character(element), Character.TYPE);
     }
     
     /**
@@ -3602,7 +3601,7 @@
      * (index < 0 || index > array.length).
      */
     public static byte[] add(byte[] array, int index, byte element) {
-        return (byte[]) add( array, index, new Byte(element), Byte.TYPE );
+        return (byte[]) add(array, index, new Byte(element), Byte.TYPE);
     }
     
     /**
@@ -3633,7 +3632,7 @@
      * (index < 0 || index > array.length).
      */
     public static short[] add(short[] array, int index, short element) {
-        return (short[]) add( array, index, new Short(element), Short.TYPE );
+        return (short[]) add(array, index, new Short(element), Short.TYPE);
     }
     
     /**
@@ -3664,7 +3663,7 @@
      * (index < 0 || index > array.length).
      */
     public static int[] add(int[] array, int index, int element) {
-        return (int[]) add( array, index, new Integer(element), Integer.TYPE );
+        return (int[]) add(array, index, new Integer(element), Integer.TYPE);
     }
     
     /**
@@ -3695,7 +3694,7 @@
      * (index < 0 || index > array.length).
      */
     public static long[] add(long[] array, int index, long element) {
-        return (long[]) add( array, index, new Long(element), Long.TYPE );
+        return (long[]) add(array, index, new Long(element), Long.TYPE);
     }
     
     /**
@@ -3726,7 +3725,7 @@
      * (index < 0 || index > array.length).
      */
     public static float[] add(float[] array, int index, float element) {
-        return (float[]) add( array, index, new Float(element), Float.TYPE );
+        return (float[]) add(array, index, new Float(element), Float.TYPE);
     }
     
     /**
@@ -3757,7 +3756,7 @@
      * (index < 0 || index > array.length).
      */
     public static double[] add(double[] array, int index, double element) {
-        return (double[]) add( array, index, new Double(element), Double.TYPE );
+        return (double[]) add(array, index, new Double(element), Double.TYPE);
     }
     
     /**