-
Bug
-
Resolution: Fixed
-
P3
-
None
errorprone reports:
java/java/util/Collections.java:3819: warning: [IsInstanceOfClass] The argument to Class#isInstance(Object) should not be a Class
@SuppressWarnings("unchecked")
public Object[] toArray() {
Object[] source = s.toArray();
/*
* Ensure that we don't get an ArrayStoreException even if
* s.toArray returns an array of something other than Object
*/
Object[] dest = (CheckedEntry.class.isInstance(
source.getClass().getComponentType()) ? source :
new Object[source.length]);
although the only consequence of the mistake is an extra copy.
java/java/util/Collections.java:3819: warning: [IsInstanceOfClass] The argument to Class#isInstance(Object) should not be a Class
@SuppressWarnings("unchecked")
public Object[] toArray() {
Object[] source = s.toArray();
/*
* Ensure that we don't get an ArrayStoreException even if
* s.toArray returns an array of something other than Object
*/
Object[] dest = (CheckedEntry.class.isInstance(
source.getClass().getComponentType()) ? source :
new Object[source.length]);
although the only consequence of the mistake is an extra copy.