missing methods of Java integeration: method.static? and primitive_to_java --------------------------------------------------------------------------
Key: JRUBY-4295 URL: http://jira.codehaus.org/browse/JRUBY-4295 Project: JRuby Issue Type: Bug Components: Java Integration Affects Versions: JRuby 1.5 Reporter: Yoko Harada Attachments: missing_methods.patch testLowerJavaSupport.rb fails for a couple of missing methods. Firstly, JavaMethod.java doesn't have @JRubyMethod annotation over static_p() method, which causes error when the method is invoked. Just adding annotation seemed to work. Then, Java.java doesn't have primitive_to_java method at all. Adding this method is easy but I guess the method should be deprecated. Probably, 10.to_java(:int) would be a more up-to-date method. Attached patch enables this new style conversion. For example: {noformat} require 'java' prim = 10.to_java(:int) p prim prim = 10.to_java(:float) p prim prim = 10.to_java(:double) p prim {noformat} produces: {noformat} #<java.lang.Integer:0x6db468> #<java.lang.Float:0x354a57> #<java.lang.Double:0xac385a> {noformat} The patch might be rough and should be improved more, but it realizes what Java integration needs. -- 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