LUCENE-2642: Fix some reflection issues

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@996623 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2010-09-13 18:11:53 +00:00
parent feabadea20
commit d51f194d11
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}