Unnecessary casts (clone)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@753658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-14 13:55:29 +00:00
parent a7670821dc
commit 94036044a4
3 changed files with 12 additions and 12 deletions

View File

@ -278,7 +278,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (Object[]) array.clone(); return array.clone();
} }
/** /**
@ -294,7 +294,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (long[]) array.clone(); return array.clone();
} }
/** /**
@ -310,7 +310,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (int[]) array.clone(); return array.clone();
} }
/** /**
@ -326,7 +326,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (short[]) array.clone(); return array.clone();
} }
/** /**
@ -342,7 +342,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (char[]) array.clone(); return array.clone();
} }
/** /**
@ -358,7 +358,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (byte[]) array.clone(); return array.clone();
} }
/** /**
@ -374,7 +374,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (double[]) array.clone(); return array.clone();
} }
/** /**
@ -390,7 +390,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (float[]) array.clone(); return array.clone();
} }
/** /**
@ -406,7 +406,7 @@ public class ArrayUtils {
if (array == null) { if (array == null) {
return null; return null;
} }
return (boolean[]) array.clone(); return array.clone();
} }
// Subarrays // Subarrays

View File

@ -282,7 +282,7 @@ public abstract class StrMatcher {
*/ */
CharSetMatcher(char chars[]) { CharSetMatcher(char chars[]) {
super(); super();
this.chars = (char[]) chars.clone(); this.chars = chars.clone();
Arrays.sort(this.chars); Arrays.sort(this.chars);
} }

View File

@ -447,7 +447,7 @@ public class StrTokenizer implements ListIterator, Cloneable {
*/ */
public String[] getTokenArray() { public String[] getTokenArray() {
checkTokenized(); checkTokenized();
return (String[]) tokens.clone(); return tokens.clone();
} }
/** /**
@ -1103,7 +1103,7 @@ public class StrTokenizer implements ListIterator, Cloneable {
// this method exists to enable 100% test coverage // this method exists to enable 100% test coverage
StrTokenizer cloned = (StrTokenizer) super.clone(); StrTokenizer cloned = (StrTokenizer) super.clone();
if (cloned.chars != null) { if (cloned.chars != null) {
cloned.chars = (char[]) cloned.chars.clone(); cloned.chars = cloned.chars.clone();
} }
cloned.reset(); cloned.reset();
return cloned; return cloned;