5 Replies Latest reply on Feb 1, 2011 4:45 PM by 82757

    Generics bug in Sun compiler?

      The code show compiles using the oracle compiler, but when executed generate a NoSuchMethodError. Apparently, this doesn't occur when run under Eclipse, presumably compiled byJikes. Is this a known bug? (Compiled using 1.6.0_21)
      public class Bug  {
          public static void main(String[] args) {
              X x = new X();
          public static interface A {
              void foo();
          public static interface B {
              void bar();
          public static class FooBar implements A, B {
              @Override public void foo() {
              @Override public void bar() {
          public static class Z<T extends A & B, TT extends T> {
              final TT t;
              public Z(final TT t) {
                  this.t = t;
              void da() {
          public static class X extends Z<FooBar, FooBar> {
              public X() {
                  super(new FooBar());
      Exception in thread "main" java.lang.NoSuchMethodError: com.iontrading.anvil.tradelibrary.bus.Bug$A.bar()V
           at com.iontrading.anvil.tradelibrary.bus.Bug$Z.da(Bug.java:40)
           at com.iontrading.anvil.tradelibrary.bus.Bug.main(Bug.java:8)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)