JRuby (please use github issues at http://bugs.jruby.org)
  1. JRuby (please use github issues at http://bugs.jruby.org)
  2. JRUBY-2999

Regression: Inheriting method with same name from two Java interfaces causes Java classloader error

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.1.4
    • Fix Version/s: JRuby 1.2
    • Component/s: Java Integration
    • Labels:
      None
    • Number of attachments :
      0

      Description

      public interface InterruptibleRunnable {
        void run() throws Exception;
      }
      
      class MyRunnable
        include java.lang.Runnable
        include InterruptibleRunnable
        def run; end
      end
      

      This code works on JRuby 1.1.3, but causes an exception on JRuby trunk (tested with r7708):

      java.lang.ClassFormatError: Duplicate method name&signature in class file InterfaceImpl1388241424
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
      	at org.jruby.util.JRubyClassLoader.defineClass(JRubyClassLoader.java:22)
      	at org.jruby.java.MiniJava.defineOldStyleImplClass(MiniJava.java:510)
      	at org.jruby.java.MiniJava.createOldStyleImplClass(MiniJava.java:193)
      	at org.jruby.javasupport.Java.new_proxy_instance2(Java.java:1565)
      	at org.jruby.java.proxies.JavaInterfaceTemplate.jcreateProxy(JavaInterfaceTemplate.java:251)
      	at org.jruby.java.proxies.JavaInterfaceTemplate.access$000(JavaInterfaceTemplate.java:23)
      	at org.jruby.java.proxies.JavaInterfaceTemplate$3.call(JavaInterfaceTemplate.java:158)
      	at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodNoBlock.call(JavaMethod.java:62)
      	at org.jruby.RubyClass.finvoke(RubyClass.java:343)
      	at org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:297)
      	at org.jruby.java.proxies.JavaInterfaceTemplate$2.call(JavaInterfaceTemplate.java:142)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:242)
      	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:151)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:275)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:116)
      	at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      	at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
      	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
      	at org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:163)
      	at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:140)
      	at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:232)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:266)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:85)
      	at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:63)
      	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
      	at org.jruby.ast.BlockNode.interpret(BlockNode.java:67)
      	at org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:163)
      	at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:140)
      	at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190)
      	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:248)
      	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:34)
      	at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
      	at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:101)
      	at org.jruby.ast.BlockNode.interpret(BlockNode.java:67)
      	at org.jruby.internal.runtime.methods.DefaultMethod.interpretedCall(DefaultMethod.java:163)
      	at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:140)
      

        Activity

        Hide
        Daniel Spiewak added a comment -

        I can repeat this with r7789 as well as 1.1.4. This does interfere with some experimentation that I've been working on, so I would appreciate a fix. In the meantime, I guess it's back to 1.1.2...

        Show
        Daniel Spiewak added a comment - I can repeat this with r7789 as well as 1.1.4. This does interfere with some experimentation that I've been working on, so I would appreciate a fix. In the meantime, I guess it's back to 1.1.2...
        Hide
        Charles Oliver Nutter added a comment -

        Fixed in r9083.

        Show
        Charles Oliver Nutter added a comment - Fixed in r9083.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Dmitry Jemerov
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: