Skip to content

Commit 3f029c9

Browse files
committed
Types: eliminate GenTyRef use in component method
The implementation without it is simple enough.
1 parent ff499da commit 3f029c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/java/org/scijava/util/Types.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,13 @@ public static Type array(final Type componentType) {
374374
* Gets the component type of the given array type, or null if not an array.
375375
*/
376376
public static Type component(final Type type) {
377-
return GenericTypeReflector.getArrayComponentType(type);
377+
if (type instanceof Class) {
378+
return ((Class<?>) type).getComponentType();
379+
}
380+
if (type instanceof GenericArrayType) {
381+
return ((GenericArrayType) type).getGenericComponentType();
382+
}
383+
return null;
378384
}
379385

380386
/**

0 commit comments

Comments
 (0)