commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r753658 - in /commons/proper/lang/trunk/src/java/org/apache/commons/lang: ArrayUtils.java text/StrMatcher.java text/StrTokenizer.java
Date Sat, 14 Mar 2009 13:55:30 GMT
Author: sebb
Date: Sat Mar 14 13:55:29 2009
New Revision: 753658

URL: http://svn.apache.org/viewvc?rev=753658&view=rev
Log:
Unnecessary casts (clone)

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrMatcher.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.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=753658&r1=753657&r2=753658&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 Sat Mar 14
13:55:29 2009
@@ -278,7 +278,7 @@
         if (array == null) {
             return null;
         }
-        return (Object[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -294,7 +294,7 @@
         if (array == null) {
             return null;
         }
-        return (long[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -310,7 +310,7 @@
         if (array == null) {
             return null;
         }
-        return (int[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -326,7 +326,7 @@
         if (array == null) {
             return null;
         }
-        return (short[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -342,7 +342,7 @@
         if (array == null) {
             return null;
         }
-        return (char[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -358,7 +358,7 @@
         if (array == null) {
             return null;
         }
-        return (byte[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -374,7 +374,7 @@
         if (array == null) {
             return null;
         }
-        return (double[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -390,7 +390,7 @@
         if (array == null) {
             return null;
         }
-        return (float[]) array.clone();
+        return array.clone();
     }
 
     /**
@@ -406,7 +406,7 @@
         if (array == null) {
             return null;
         }
-        return (boolean[]) array.clone();
+        return array.clone();
     }
 
     // Subarrays

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrMatcher.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrMatcher.java?rev=753658&r1=753657&r2=753658&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrMatcher.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrMatcher.java Sat Mar
14 13:55:29 2009
@@ -282,7 +282,7 @@
          */
         CharSetMatcher(char chars[]) {
             super();
-            this.chars = (char[]) chars.clone();
+            this.chars = chars.clone();
             Arrays.sort(this.chars);
         }
 

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=753658&r1=753657&r2=753658&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sat
Mar 14 13:55:29 2009
@@ -447,7 +447,7 @@
      */
     public String[] getTokenArray() {
         checkTokenized();
-        return (String[]) tokens.clone();
+        return tokens.clone();
     }
 
     /**
@@ -1103,7 +1103,7 @@
         // this method exists to enable 100% test coverage
         StrTokenizer cloned = (StrTokenizer) super.clone();
         if (cloned.chars != null) {
-            cloned.chars = (char[]) cloned.chars.clone();
+            cloned.chars = cloned.chars.clone();
         }
         cloned.reset();
         return cloned;



Mime
View raw message