Skip to content

Fix Java::JavaLangReflect::GenericSignatureFormatError when reflecting reified annotation values#4187

Merged
headius merged 1 commit intojruby:masterfrom
cheister:fix-generic-signature-format-error
Sep 30, 2016
Merged

Fix Java::JavaLangReflect::GenericSignatureFormatError when reflecting reified annotation values#4187
headius merged 1 commit intojruby:masterfrom
cheister:fix-generic-signature-format-error

Conversation

@cheister
Copy link

In 84eb04f the java class names for anonymous classes were changed to have a colon in them. This causes problems when java tries to use reflection to get the classname because colon isn't a valid classname character.

The error from java is:

Failure/Error: Unable to find java.lang.Class.createAnnotationData(java/lang/Class.java to read failed line

     Java::JavaLangReflect::GenericSignatureFormatError:
       Signature Parse error: expected '<' or ';' but got :
        Remaining input: :0x2b80e5a9;
     # java.lang.Class.createAnnotationData(java/lang/Class.java:3521)
     # java.lang.Class.annotationData(java/lang/Class.java:3510)
     # java.lang.Class.getDeclaredAnnotations(java/lang/Class.java:3477)
     # java_integration.fixtures.Reflector.getDeclaredAnnotation(java_integration/fixtures/Reflector.java:94)
     # java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
     # org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
     # org.jruby.javasupport.JavaMethod.invokeStaticDirect(org/jruby/javasupport/JavaMethod.java:370)
     # RUBY.block in (root)(/Users/cheister/Development/jruby/spec/java_integration/reify/become_java_spec.rb:207)

This PR just changes the classname back to using an underscore instead of a colon.

@headius headius merged commit 895e1f4 into jruby:master Sep 30, 2016
@headius headius added this to the JRuby 9.1.6.0 milestone Sep 30, 2016
@headius
Copy link
Member

headius commented Sep 30, 2016

Thanks!

@cheister cheister deleted the fix-generic-signature-format-error branch September 30, 2016 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants