Completed
Details
Assignee
UnassignedUnassignedReporter
Andy FingerhutAndy FingerhutLabels
Approval
OkPatch
Code and TestPriority
MajorAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Andy Fingerhut
Andy FingerhutLabels
Approval
Ok
Patch
Code and Test
Priority

Affects versions
Fix versions
Created August 22, 2013 at 1:55 AM
Updated October 25, 2013 at 5:01 PM
Resolved October 25, 2013 at 5:01 PM
REPL session reproducing the problem:
% java -cp clojure.jar clojure.main Clojure 1.6.0-master-SNAPSHOT user=> (use 'clojure.reflect) nil user=> (import '[clojure.reflect AsmReflector]) clojure.reflect.AsmReflector user=> (def cl (.getContextClassLoader (Thread/currentThread))) #'user/cl user=> (def asm-reflector (AsmReflector. cl)) #'user/asm-reflector user=> (type-reflect 'java.lang.SuppressWarnings :reflector asm-reflector) AbstractMethodError clojure.reflect.AsmReflector$reify__9181.visitAnnotation(Ljava/lang/String;Z)Lclojure/asm/AnnotationVisitor; clojure.asm.ClassReader.accept (ClassReader.java:593)
Issue discovered when trying out a build of Clojure source code with JDK8 early access version b103. In Clojure's set of tests, one of the classes tested with type-reflect fails with JDK8 because annotations were added to that class in JDK8, but it did not have annotations in earlier JDK versions. The same issue exists with JDK6 and JDK7 for any class with annotations, though – it is not unique to JDK8.
Analysis:
Definition of AsmReflector type in src/clj/clojure/reflect/java.clj has a reify for a ClassVisitor with no definition for a visitAnnotation method. This method is called for classes with annotations.
Patch: clj-1246-fix-type-reflect-exception-patch-v1.diff
Screened by: Alex Miller