Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4200682

Static inner class does not get instantiated correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • tools
    • x86
    • windows_nt



      Name: gsC80088 Date: 01/05/99


      public class Outer {
         static class Inner {
            public static void foo() {
               System.out.println("foo yourself");
            }
         }

         public static void main(String[] args) {
            Inner i = new Outer().new Inner();
            i.foo();

      /* workaround...
            Outer o = new Outer();
            Outer.Inner i = o.new Inner();
            i.foo();
      */
         }
      }
      prints:
      Exception in thread "main" java.lang.VerifyError: (class: Outer, method: main si
      gnature: ([Ljava/lang/String;)V) Expecting to find unitialized object on stack
      (Review ID: 40692)
      ======================================================================

            Unassigned Unassigned
            gstone Greg Stone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: