-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Loading marshalled Java enums with anonymous classes does not work #3526
Comments
yes this should work just fine - we'll be looking at it, thanks for the report! |
here's the deal - anonymous Java classes used to look a bit weird on the Ruby end e.g.
yet for some reason marshalling works these works on 1.7.19 but does not serialize the "correct" class :
this would be easily fixed if the ... really hesitant to revert this as the previous behaviour is not correct and might lead to ugly bugs ;( |
Ah yeah, the earlier version did not work correctly either. I never noticed that because we were just accidentally marshalling and unmarshalling enums and that started to fail. So the wrong result was never used. |
…us classes local and anonymous classes had empty names <= 1.7.19 and the change (for anonymous classes) was not spec-ed properly, but with features such as Java proxy marshalling (jruby#3526) this gained importance.
…us classes local and anonymous classes had empty names <= 1.7.19 and the change (for anonymous classes) was not spec-ed properly, but with features such as Java proxy marshalling (#3526) this gained importance.
* jruby-1_7: (27 commits) Update jnr-posix to finally fix 32 bit JVM crasher on windows stat pend marshaling behavior - not working for Java non-member classes (GH-3526) local (non-member) classes should have correct name just like anonymous classes DRY out getClassFromPath usage in UnmarshalStream (all delegating to one method) review runtime's getClassFromPath hide unmarshalObject methods that use private inner type as a parameter Update for newer jnr-posix for windows 32 bit JVM stat workaround Remove remaining `should` uses from compiler specs. Don't deoptimize while loops just because of a block arg. Always assign masgn destructured args in block as block-local. Move parser scripts to tool. Add case for breakage fixed in b93fbb6e431. Check for empty identifiers and treat them as false. Same fix for AOT as for interp for #3180. Also use the anonymous wrap class for pushRubyClass, for defs. More robust, less breaky fix to omit bad class/package elements. Revert "Use methods instead of procs for converters." Fixes #3550. Warning "io/console not supported; tty will not be manipulated" occurs again on 1.7.23 updating to jcodings messes with this obscure char no longer being considered a space. Update to latest jcodings ...
working fine on 9K - calling it a wont-fix for jruby 1.7.x as its better to fail than de-serialize improperly. |
If we have a class
Then, running
CLASSPATH="." ruby -e 'Java::SimpleCase.values.each { |e| Marshal.load(Marshal.dump(e)) }'
fails forBUZZ
with errorI am not sure if this should work, but it did in
1.7.19
and no longer works in1.7.20
and later ones.The text was updated successfully, but these errors were encountered: