JRuby 10.0.1.0 / 10.0.2.0 had a small regression on Java integration due: 6e0f8bd
RubyModule#hashCode() ends up being called while setting up Java proxies, when interfaces are implemented, leading to:
public class SampleClassWithHashMethod implements Cloneable {
public static int hash(Object arg) {
return 42;
}
}
ArgumentError:
no method 'hash' (for zero arguments) on Java::SampleClassWithHashMethod
# java/lang/Thread.java:2450:in 'getStackTrace'
# org/jruby/runtime/backtrace/TraceType.java:285:in 'getBacktraceData'
# org/jruby/runtime/backtrace/TraceType.java:66:in 'getBacktrace'
# org/jruby/RubyException.java:533:in 'captureBacktrace'
# org/jruby/exceptions/RaiseException.java:219:in 'preRaise'
# org/jruby/exceptions/RaiseException.java:69:in '<init>'
# org/jruby/exceptions/Exception.java:39:in '<init>'
# org/jruby/exceptions/StandardError.java:38:in '<init>'
# org/jruby/exceptions/ArgumentError.java:38:in '<init>'
# org/jruby/RubyArgumentError.java:59:in 'constructThrowable'
# org/jruby/RubyException.java:492:in 'toThrowable'
# org/jruby/exceptions/RaiseException.java:98:in 'from'
# org/jruby/Ruby.java:4436:in 'newRaiseException'
# org/jruby/api/Error.java:35:in 'argumentError'
# org/jruby/java/invokers/RubyToJavaInvoker.java:707:in 'newErrorDueNoMatchingCallable'
# org/jruby/java/invokers/RubyToJavaInvoker.java:436:in 'findCallableArityZero'
# org/jruby/java/invokers/StaticMethodInvoker.java:29:in 'call'
# org/jruby/runtime/callsite/CachingCallSite.java:193:in 'call'
# org/jruby/RubyModule.java:3219:in 'hashCode'
# java/util/WeakHashMap.java:309:in 'hash'
# java/util/WeakHashMap.java:602:in 'remove'
# org/jruby/RubyClass.java:1331:in 'removeClass'
# org/jruby/RubyClass.java:1361:in 'removeSubclass'
# org/jruby/RubyClass.java:1376:in 'replaceSubclass'
# org/jruby/RubyModule.java:4463:in 'proceedWithInclude'
# org/jruby/RubyModule.java:4333:in 'doIncludeModule'
# org/jruby/RubyModule.java:1362:in 'includeModule'
# org/jruby/RubyModule.java:1740:in 'include'
# org/jruby/javasupport/Java.java:557:in 'generateClassProxy'
# org/jruby/javasupport/Java.java:510:in 'createProxyClassForClass'
# org/jruby/javasupport/JavaSupport.java:129:in 'computeProxyClass'
# org/jruby/util/collections/ClassValueCalculator.java:12:in 'apply'
# org/jruby/util/collections/ClassValueCalculator.java:9:in 'apply'
# org/jruby/util/collections/StableClassValue.java:47:in 'get'
# org/jruby/util/collections/StableClassValue.java:18:in 'get'
# org/jruby/javasupport/JavaSupport.java:399:in 'getProxyClassFromCache'
# org/jruby/javasupport/Java.java:471:in 'getProxyClass'
# org/jruby/javasupport/binding/MethodGatherer.java:390:in 'installInnerClasses'
# org/jruby/javasupport/binding/MethodGatherer.java:158:in 'initialize'
# org/jruby/javasupport/binding/ClassInitializer.java:44:in 'initialize'
# org/jruby/javasupport/binding/Initializer.java:60:in 'setupProxyClass'
# org/jruby/javasupport/Java.java:595:in 'createProxyClass'
# org/jruby/javasupport/Java.java:553:in 'generateClassProxy'
# org/jruby/javasupport/Java.java:510:in 'createProxyClassForClass'
# org/jruby/javasupport/JavaSupport.java:129:in 'computeProxyClass'
# org/jruby/util/collections/ClassValueCalculator.java:12:in 'apply'
# org/jruby/util/collections/ClassValueCalculator.java:9:in 'apply'
# org/jruby/util/collections/StableClassValue.java:47:in 'get'
# org/jruby/util/collections/StableClassValue.java:18:in 'get'
# org/jruby/javasupport/JavaSupport.java:399:in 'getProxyClassFromCache'
# org/jruby/javasupport/Java.java:471:in 'getProxyClass'
this happens when the target Java class has a (static) hash(...) method, believe this wasn't intended with the change...
JRuby 10.0.1.0 / 10.0.2.0 had a small regression on Java integration due: 6e0f8bd
RubyModule#hashCode()ends up being called while setting up Java proxies, when interfaces are implemented, leading to:this happens when the target Java class has a (static)
hash(...)method, believe this wasn't intended with the change...