From d51f194d116af236df6580fea3bb648ca2be5db8 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 13 Sep 2010 18:11:53 +0000 Subject: [PATCH] LUCENE-2642: Fix some reflection issues git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@996623 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/test/org/apache/lucene/util/LuceneTestCase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java index d87ced4d0b2..f94310e2b5e 100644 --- a/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java @@ -66,6 +66,7 @@ import java.io.IOException; import java.io.PrintStream; import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -785,8 +786,9 @@ public abstract class LuceneTestCase extends Assert { for (Method m : getTestClass().getJavaClass().getMethods()) if (m.getName().startsWith("test") && m.getAnnotation(Test.class) == null && + (m.getModifiers() & (Modifier.STATIC|Modifier.ABSTRACT)) == 0 && m.getParameterTypes().length == 0 && - m.getGenericReturnType() == Void.TYPE) + m.getReturnType() == Void.TYPE) testMethods.add(new FrameworkMethod(m)); return testMethods; }