Cannot reference Rectangle2D.Double class jruby seem to search for a method


#1

The following very simple case I cannot get to work.

require ‘java’
class Test
java.awt.geom.Rectangle2D.Double.new(20,40,40,20)
end

=> undefined method `Double’ for Java::JavaAwtGeom::Rectangle2D:Class

(NoMethodError)

Possible reason:
I do understand that jruby is looking for a method instead of class. It
maybe has something to do with the fact that between the java and jruby
lookup of methods and functions in combination with the java type double
and
case transformations??

Does somebody has a solution

I used jruby 1.1.6 (ruby 1.8.6 patchlevel 114) (2008-12-17 rev 8388)
[i386-java]

Simple equivalent in java

import java.awt.geom.Rectangle2D;

public class test {
public void testmethod() {
new Rectangle2D.Double(10, 10, 10, 10);
}
}

Javadoc of the class

java.awt.geom

Class Rectangle2D.Double

java.lang.Object

extended by java.awt.geom.RectangularShape

extended by java.awt.geom.Rectangle2D

extended by java.awt.geom.Rectangle2D.Double


View this message in context:
http://www.nabble.com/cannot-reference-Rectangle2D.Double-class-jruby-seem-to-search-for-a-method-tp21756578p21756578.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

2009/1/30 remgo removed_email_address@domain.invalid:

The following very simple case I cannot get to work.

require ‘java’
class Test
java.awt.geom.Rectangle2D.Double.new(20,40,40,20)
end

require ‘java’
class Test
java.awt.geom.Rectangle2D::Double.new(20,40,40,20)
end

Cheers,

Serabe



To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email