Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.0, JRuby 0.9.1, JRuby 0.9.2, JRuby 0.9.8, JRuby 0.9.9, JRuby 1.0.0RC1, JRuby 1.0.0RC2, JRuby 1.0.0RC3
-
Fix Version/s: JRuby 1.1b1
-
Component/s: Core Classes/Modules
-
Labels:None
Description
Multiple Java-based classes in JRuby do not provide the appropriate allocator/initializer combination necessary for things like Class.new and marshalling to work correctly. In most cases, I have set these to use the NOT_ALLOCATABLE_ALLOCATOR, but this must be fixed for all types.
I list the ones I know of here.
NativeException: If NativeException is expected to be used from Ruby code, it should provide a real allocator and initializer to be used. Otherwise Class.new will fail, as will marshalling.
RubyThreadGroup: ThreadGroup can't be marshalled, but it could be Class.new'ed. We may also want to replace RubyThreadGroup with lightweight state.
JavaClass, JavaMethod, JavaConstructor, JavaField: May or may not need the correct allocate/initialize combo, since they're primarily used internally.
JavaObject: see JRUBY-414
RubyMethod, RubyUnboundMethod: Method and UnboundMethod can't be instantiated, but examine whether the allocate/initialize combo makes sense here.
RubyStruct: Struct is a little weird, since it creates new classes. Structs are also very likely to be candidates for marshalling. Currently the top-level Struct class uses NOT_ALLOC.. but this likely will interfere with struct instances being marshallable. Fix.
Process::Status can't be instantiated, but it could potentially be marshalled. Confirm correct behavior and fix.
NilClass: I set up nil to have an allocator that just returns the nil object from the provided runtime. I'm not sure if this is necessary or correct. NOT_ALLOC might be better?
File::Stat: definitely needs to be fixed.
Generator: ??
Issue Links
- is related to
-
JRUBY-6103
allocator undefined for NativeException
-
Finish for 0.9.9. Most of this has already been done.