Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 77790a05d42b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7ad625f80ef4
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Apr 6, 2016

  1. Copy the full SHA
    1c3ae19 View commit details
  2. Copy the full SHA
    33f883f View commit details
  3. Copy the full SHA
    7ad625f View commit details
Original file line number Diff line number Diff line change
@@ -411,7 +411,7 @@ private IRubyObject arrayRange(final ThreadContext context,
throw context.runtime.newTypeError("only Fixnum ranges supported");
}

public static class ArrayNewMethod extends org.jruby.internal.runtime.methods.JavaMethod.JavaMethodOne {
private static final class ArrayNewMethod extends org.jruby.internal.runtime.methods.JavaMethod.JavaMethodOne {

private final DynamicMethod newMethod;

Original file line number Diff line number Diff line change
@@ -49,14 +49,8 @@ public ArrayJavaProxyCreator(final Ruby runtime) {
aggregateDimensions(sizes);
}

@Deprecated // no longer used
public void setup(ThreadContext context, IRubyObject javaClass, IRubyObject[] sizes) {
elementType = (Class) javaClass.toJava(Class.class);
aggregateDimensions(sizes);
}

@JRubyMethod(name = "[]", required = 1, rest = true)
public IRubyObject op_aref(ThreadContext context, IRubyObject[] sizes) {
public final IRubyObject op_aref(ThreadContext context, IRubyObject[] sizes) {
Arity.checkArgumentCount(context.runtime, sizes, 1, -1);
aggregateDimensions(sizes);
return this;
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ public static RubyClass createConcreteJavaProxy(final ThreadContext context) {
return ConcreteJavaProxy;
}

private static class InitializeMethod extends org.jruby.internal.runtime.methods.JavaMethod {
private static final class InitializeMethod extends org.jruby.internal.runtime.methods.JavaMethod {

private final CallSite jcreateSite = MethodIndex.getFunctionalCallSite("__jcreate!");

@@ -86,7 +86,7 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz

}

private static class NewMethod extends org.jruby.internal.runtime.methods.JavaMethod {
private static final class NewMethod extends org.jruby.internal.runtime.methods.JavaMethod {

private final CallSite jcreateSite = MethodIndex.getFunctionalCallSite("__jcreate!");
final DynamicMethod newMethod;
4 changes: 4 additions & 0 deletions test/jruby/test_higher_javasupport.rb
Original file line number Diff line number Diff line change
@@ -1485,6 +1485,10 @@ def test_java_proxy_coerce_into_ruby_object; require 'jruby' # @see GH-1925
JRuby.runtime.defineReadonlyVariable('$an_answer', proxied_java_object, org.jruby.internal.runtime.GlobalVariable::Scope::GLOBAL)
assert $an_answer
assert_equal 42.to_s, $an_answer.get

proxied_java_object = Java::int[1].new; proxied_java_object[0] = 42
JRuby.runtime.defineReadonlyVariable('$an_answer', proxied_java_object, org.jruby.internal.runtime.GlobalVariable::Scope::GLOBAL)
assert_equal 42, $an_answer[0]
end

def test_callable_no_match_raised_errors