Skip to content

Commit 11608e5

Browse files
committed
ClassUtils: skip Object when scanning for fields
The java.lang.Object class does not have any annotated fields at all. And even if it did, it definitely does not have any fields annotated with SciJava annotations such as org.scijava.plugin.Parameter, which are the main sorts of fields we are interested in.
1 parent 7efd5e5 commit 11608e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public static <A extends Annotation> List<Field> getAnnotatedFields(
356356
public static <A extends Annotation> void getAnnotatedFields(
357357
final Class<?> c, final Class<A> annotationClass, final List<Field> fields)
358358
{
359-
if (c == null) return;
359+
if (c == null || c == Object.class) return;
360360

361361
// check supertypes for annotated fields first
362362
getAnnotatedFields(c.getSuperclass(), annotationClass, fields);

0 commit comments

Comments
 (0)