Skip to content

Commit 39aa8a5

Browse files
[LANG-1773] Apache Commons Lang no longer builds on Android (#1381)
Remove an unnecessary reference to `java.lang.reflect.AnnotatedType`, which does not exist on Android. We immediately call `getType()` on it, so we might just as well use the method that gives us `Type[]` directly.
1 parent 4a6ae3e commit 39aa8a5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/java/org/apache/commons/lang3/reflect/TypeUtils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package org.apache.commons.lang3.reflect;
1818

19-
import java.lang.reflect.AnnotatedType;
2019
import java.lang.reflect.Array;
2120
import java.lang.reflect.GenericArrayType;
2221
import java.lang.reflect.GenericDeclaration;
@@ -1361,8 +1360,8 @@ private static boolean isAssignable(final Type type, final WildcardType toWildca
13611360
*/
13621361
private static boolean isCyclical(final Class<?> cls) {
13631362
for (final TypeVariable<?> typeParameter : cls.getTypeParameters()) {
1364-
for (final AnnotatedType annotatedBound : typeParameter.getAnnotatedBounds()) {
1365-
if (annotatedBound.getType().getTypeName().contains(cls.getName())) {
1363+
for (final Type bound : typeParameter.getBounds()) {
1364+
if (bound.getTypeName().contains(cls.getName())) {
13661365
return true;
13671366
}
13681367
}

0 commit comments

Comments
 (0)