Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: JRuby 0.9.8
-
Fix Version/s: JRuby 0.9.8
-
Component/s: Java Integration
-
Labels:None
-
Environment:jruby-trunk, 1.6.0_01-ea, Slackware Linux 11.0.0
-
Number of attachments :
Description
Try the following example:
#!/usr/bin/env jruby
require 'java'
Attributes = java.util.jar.Attributes
Attributes::Name.new('hi') # works
Ellipse2D = java.awt.geom.Ellipse2D
Ellipse2D::Float.new # fails
Tried with 0.9.2 and fresh trunk build (20071001)
This doesn't seem to be a problem with abstract classes, but with the handling of Float which is already defined as a constant. Here's a sample program:
I have abstract commented out for the enclosing class above, but in practice it makes no difference whether it is there or not:
irb(main):001:0> require 'java' => true irb(main):002:0> jruby425 = org.bug.JRuby425 => #<Class:01x9cbfa1> irb(main):003:0> jruby425::Float.new (irb):1 warning: toplevel constant Float referenced by #<Class:01x9cbfa1>::Float NoMethodError: undefined method `new' for Float:Class from (irb):1:in `method_missing' from (irb):1:in `binding' irb(main):004:0> jruby425::Sink.new => #<JavaUtilities::null::Sink:0x68fede @java_object=org.bug.JRuby425$Sink@990a46> irb(main):005:0>Note that we can instantiate Sink without a problem, regardless of whether the enclosing class is abstract or not.