Index: lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java =================================================================== --- lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java (revision 1451564) +++ lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java (working copy) @@ -252,12 +252,14 @@ tokenfilters = new ArrayList>(); charfilters = new ArrayList>(); for (final Class c : analysisClasses) { + // TODO: Fix below code to use c.isAnnotationPresent(). It was changed + // to the null check to work around a bug in JDK 8 b78 (see LUCENE-4808). final int modifiers = c.getModifiers(); if ( // don't waste time with abstract classes or deprecated known-buggy ones Modifier.isAbstract(modifiers) || !Modifier.isPublic(modifiers) || c.isSynthetic() || c.isAnonymousClass() || c.isMemberClass() || c.isInterface() - || c.isAnnotationPresent(Deprecated.class) + || c.getAnnotation(Deprecated.class) != null || !(Tokenizer.class.isAssignableFrom(c) || TokenFilter.class.isAssignableFrom(c) || CharFilter.class.isAssignableFrom(c)) ) { continue; @@ -265,7 +267,7 @@ for (final Constructor ctor : c.getConstructors()) { // don't test synthetic or deprecated ctors, they likely have known bugs: - if (ctor.isSynthetic() || ctor.isAnnotationPresent(Deprecated.class) || brokenConstructors.get(ctor) == ALWAYS) { + if (ctor.isSynthetic() || ctor.getAnnotation(Deprecated.class) != null || brokenConstructors.get(ctor) == ALWAYS) { continue; } if (Tokenizer.class.isAssignableFrom(c)) { Index: lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java =================================================================== --- lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java (revision 1451564) +++ lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java (working copy) @@ -131,7 +131,9 @@ Class targetClass = RandomizedContext.current().getTargetClass(); avoidCodecs = new HashSet(); - if (targetClass.isAnnotationPresent(SuppressCodecs.class)) { + // TODO: Fix below code to use c.isAnnotationPresent(). It was changed + // to the null check to work around a bug in JDK 8 b78 (see LUCENE-4808). + if (targetClass.getAnnotation(SuppressCodecs.class) != null) { SuppressCodecs a = targetClass.getAnnotation(SuppressCodecs.class); avoidCodecs.addAll(Arrays.asList(a.value())); } Index: solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java =================================================================== --- solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java (revision 1451564) +++ solr/solrj/src/java/org/apache/solr/client/solrj/beans/DocumentObjectBinder.java (working copy) @@ -114,7 +114,9 @@ } for (AccessibleObject member : members) { - if (member.isAnnotationPresent(Field.class)) { + // TODO: Fix below code to use c.isAnnotationPresent(). It was changed + // to the null check to work around a bug in JDK 8 b78 (see LUCENE-4808). + if (member.getAnnotation(Field.class) != null) { member.setAccessible(true); fields.add(new DocField(member)); }