LANG-838 ArrayUtils removeElements methods clone temporary index arrays unnecessarily

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1391695 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-09-28 23:30:31 +00:00
parent 6545db8bb7
commit 2be663db75
2 changed files with 12 additions and 9 deletions

View File

@ -22,6 +22,7 @@
<body> <body>
<release version="3.2" date="TBA" description="Next release"> <release version="3.2" date="TBA" description="Next release">
<action issue="LANG-838" type="update">ArrayUtils removeElements methods clone temporary index arrays unnecessarily</action>
<action issue="LANG-832" type="fix">FastDateParser does not handle unterminated quotes correctly</action> <action issue="LANG-832" type="fix">FastDateParser does not handle unterminated quotes correctly</action>
<action issue="LANG-831" type="fix">FastDateParser does not handle white-space properly</action> <action issue="LANG-831" type="fix">FastDateParser does not handle white-space properly</action>
<action issue="LANG-830" type="fix">FastDateParser could use \Q \E to quote regexes</action> <action issue="LANG-830" type="fix">FastDateParser could use \Q \E to quote regexes</action>

View File

@ -5019,7 +5019,9 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); @SuppressWarnings("unchecked") // removeAll() always creates an array of the same type as its input
T[] result = (T[]) removeAll((Object)array, extractIndices(toRemove));
return result;
} }
/** /**
@ -5108,7 +5110,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (byte[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5197,7 +5199,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (short[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5286,7 +5288,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (int[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5375,7 +5377,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (char[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5464,7 +5466,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (long[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5553,7 +5555,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (float[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5642,7 +5644,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (double[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**
@ -5727,7 +5729,7 @@ public class ArrayUtils {
toRemove.add(found++); toRemove.add(found++);
} }
} }
return removeAll(array, extractIndices(toRemove)); return (boolean[]) removeAll((Object)array, extractIndices(toRemove));
} }
/** /**