Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
blog post notes
$JRubyMethod["name" => ["[]", "get"], "required" => 1]
def get(context:ThreadContext , arg:IRubyObject):IRubyObject
getRuntime.newFixnum @buffer.get(int(longValueFromObject(arg)))
end
class Foo
def bar
"bar"
end
def baz
{"quux" => bar}
end
end
Foo.new.baz
]$ mirah hash.mirah
NativeMethodAccessorImpl.java:-2:in `invoke0': java.lang.reflect.InvocationTargetException
from NativeMethodAccessorImpl.java:39:in `invoke'
from DelegatingMethodAccessorImpl.java:25:in `invoke'
from Method.java:597:in `invoke'
from NativeMethodAccessorImpl.java:-2:in `invoke0'
from NativeMethodAccessorImpl.java:39:in `invoke'
from DelegatingMethodAccessorImpl.java:25:in `invoke'
from Method.java:597:in `invoke'
Caused by:
hash.mirah:1:in `main': java.lang.VerifyError: (class: Foo, method: baz signature: ()Ljava/util/HashMap;) Accessing value from uninitialized register 2
from NativeMethodAccessorImpl.java:-2:in `invoke0'
# with a string
java.lang.String.java_class.java_method 'endsWith', 'java.lang.String'
# with a java proxy object
java.lang.String.java_class.java_method 'endsWith', java.lang.String
# with a symbol
java.lang.String.java_class.java_method 'charAt', :int
rake test:jvm TEST=test/jvm/test_annotations.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment