Use Arrays.copyOf and Arrays.copyOfRange where possible

Closes gh-23393
This commit is contained in:
stsypanov
2019-07-31 19:17:22 +03:00
committed by Sam Brannen
parent 216ffcfe62
commit 78d56dc61b
5 changed files with 6 additions and 12 deletions

View File

@@ -268,8 +268,7 @@ final class AttributeMethods {
return NONE;
}
Arrays.sort(methods, methodComparator);
Method[] attributeMethods = new Method[size];
System.arraycopy(methods, 0, attributeMethods, 0, size);
Method[] attributeMethods = Arrays.copyOf(methods, size);
return new AttributeMethods(annotationType, attributeMethods);
}