Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Sep 30, 2016

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.

None yet

2 participants