Selection of overloaded Java Method Signatures fails
----------------------------------------------------
Key: JRUBY-1325
URL: http://jira.codehaus.org/browse/JRUBY-1325
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.0.0
Environment: Windows XP
Reporter: greg
Assignee: Thomas E Enebo
By calling an overloaded Java method within a JRuby script the runtime selects
the wrong method for the attached example code. Calling the Java method with a
value larger than Integer.Max should select the Java method with the long
signature.
// Java class
public class Printer {
public void print(long l) {
System.out.println("print long " + l);
}
public void print(int i) {
System.out.println("print int " + i);
}
}
# JRuby script
require 'java'
include_class 'Printer'
Printer.new.print(55)
# OK: prints out print int 55
Printer.new.print(214748364700)
# Wrong: prints out print int -100
# not
# print long 214748364700
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email