Skip to content
New issue

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

java_signature cannot parse properly in a REPL after jruby/core_ext has been required #3204

Closed
rtyler opened this issue Aug 1, 2015 · 1 comment

Comments

@rtyler
Copy link

rtyler commented Aug 1, 2015

jruby-1.7.21 :002 > class Bar
jruby-1.7.21 :003?>   end
 => nil 
jruby-1.7.21 :004 > class Foo
jruby-1.7.21 :005?>   class << self
jruby-1.7.21 :006?>     def hello
jruby-1.7.21 :007?>       return 'lol'
jruby-1.7.21 :008?>       end
jruby-1.7.21 :009?>     end
jruby-1.7.21 :010?>   end
 => nil 
jruby-1.7.21 :011 > class WithSig
jruby-1.7.21 :012?>   java_signature 'void hello'
jruby-1.7.21 :013?>   def hello
jruby-1.7.21 :014?>     puts 'lol'
jruby-1.7.21 :015?>     end
jruby-1.7.21 :016?>   end
Java::OrgJrubyParser::ParserSyntaxException: syntax error, unexpected end-of-file

    from java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:497)
    from RUBY.parse(/home/tyler/.rvm/rubies/jruby-1.7.21/lib/ruby/shared/jruby/compiler/java_signature.rb:82)
    from RUBY.java_signature(/home/tyler/.rvm/rubies/jruby-1.7.21/lib/ruby/shared/jruby/core_ext/class.rb:43)
    from RUBY.WithSig((irb):12)
    from RUBY.evaluate((irb):11)
    from org.jruby.RubyKernel.eval(org/jruby/RubyKernel.java:1079)
    from org.jruby.RubyKernel.loop(org/jruby/RubyKernel.java:1479)
    from org.jruby.RubyKernel.catch(org/jruby/RubyKernel.java:1242)
    from org.jruby.RubyKernel.catch(org/jruby/RubyKernel.java:1242)
    from home.tyler.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_21.bin.irb.(root)(/home/tyler/.rvm/rubies/jruby-1.7.21/bin/irb:13)
    from home.tyler.$_dot_rvm.rubies.jruby_minus_1_dot_7_dot_21.bin.irb.(root)(home/tyler/$_dot_rvm/rubies/jruby_minus_1_dot_7_dot_21/bin//home/tyler/.rvm/rubies/jruby-1.7.21/bin/irb:13)
jruby-1.7.21 :017 > 
@kares
Copy link
Member

kares commented Nov 19, 2015

it needs the looks of a "valid" Java method signature ... () are required to be present (at the moment):
class WithSig; java_signature 'void hello()'; def hello; end; end ... works as expected

marking as an enhancement only - if anyone believes the () requirement can be relaxed ... and does it

@kares kares added this to the Invalid or Duplicate milestone Apr 6, 2016
@kares kares closed this as completed Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants