diff --git a/core/src/main/java/org/jruby/RubyHash.java b/core/src/main/java/org/jruby/RubyHash.java index b8926f92f6a..06b17dfc7b7 100644 --- a/core/src/main/java/org/jruby/RubyHash.java +++ b/core/src/main/java/org/jruby/RubyHash.java @@ -1865,14 +1865,14 @@ public IRubyObject flatten(ThreadContext context, IRubyObject level) { } @JRubyMethod(name = "compare_by_identity") - public IRubyObject getCompareByIdentity(ThreadContext context) { + public IRubyObject compare_by_identity(ThreadContext context) { modify(); setComparedByIdentity(true); return rehash(); } @JRubyMethod(name = "compare_by_identity?") - public IRubyObject getCompareByIdentity_p(ThreadContext context) { + public IRubyObject compare_by_identity_p(ThreadContext context) { return context.runtime.newBoolean(isComparedByIdentity()); } diff --git a/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java b/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java index 9d2872026b4..49405a4e7ac 100644 --- a/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java +++ b/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java @@ -293,7 +293,7 @@ public RubyHash rehash() { } @Override - public RubyBoolean getCompareByIdentity_p(ThreadContext context) { + public RubyBoolean compare_by_identity_p(ThreadContext context) { // NOTE: obviously little we can do to detect - but at least report Java built-in one : return context.runtime.newBoolean( mapDelegate() instanceof java.util.IdentityHashMap ); } @@ -770,13 +770,13 @@ public IRubyObject flatten(ThreadContext context, IRubyObject level) { } @JRubyMethod(name = "compare_by_identity") - public IRubyObject getCompareByIdentity(ThreadContext context) { + public IRubyObject compare_by_identity(ThreadContext context) { return this; // has no effect - mostly for compatibility } @JRubyMethod(name = "compare_by_identity?") - public IRubyObject getCompareByIdentity_p(ThreadContext context) { - return getOrCreateRubyHashMap().getCompareByIdentity_p(context); + public IRubyObject compare_by_identity_p(ThreadContext context) { + return getOrCreateRubyHashMap().compare_by_identity_p(context); } @Override