We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1] pry(main)> class NormalClass [1] pry(main)* java_signature "java.lang.String hello" [1] pry(main)* def self.hello [1] pry(main)* return 'hi' [1] pry(main)* end [1] pry(main)* end => nil [2] pry(main)> require 'jruby/core_ext' => true [4] pry(main)> NormalClass.become_java!.declared_methods => java.lang.reflect.Method[public static void rubyobj.NormalClass.clinit(org.jruby.Ruby,org.jruby.RubyClass), public static org.jruby.runtime.builtin.IRubyObject rubyobj.NormalClass.hello()]@55634720 [5] pry(main)>
NOTE the method has a return type of IRubyObject instead of java.lang.String
IRubyObject
java.lang.String
When using class << self the signature is correct however
class << self
[7] pry(main)> class Foo [7] pry(main)* class << self [7] pry(main)* java_signature 'java.lang.String hello' [7] pry(main)* def hello() [7] pry(main)* return 'ohai' [7] pry(main)* end [7] pry(main)* end [7] pry(main)* end Java::OrgJrubyParser::ParserSyntaxException: syntax error, unexpected end-of-file from java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:497) [8] pry(main)> ➜ ~ pry [1] pry(main)> class Foo [1] pry(main)* class << self [1] pry(main)* java_signature 'java.lang.String hello' [1] pry(main)* def hello() [1] pry(main)* return 'lol' [1] pry(main)* end [1] pry(main)* end [1] pry(main)* end => nil [2] pry(main)> require 'jruby/core_ext' => true [3] pry(main)> Foo.become_java!.declared_methods => java.lang.reflect.Method[public static void rubyobj.Foo.clinit(org.jruby.Ruby,org.jruby.RubyClass), public static org.jruby.runtime.builtin.IRubyObject rubyobj.Foo.hello()]@26e356f0 [4] pry(main)>
The text was updated successfully, but these errors were encountered:
believe this is fine as it is - behaves the same as similar Ruby "annotation" methods e.g. public ...
public
Sorry, something went wrong.
No branches or pull requests
NOTE the method has a return type of
IRubyObject
instead ofjava.lang.String
When using
class << self
the signature is correct howeverThe text was updated successfully, but these errors were encountered: