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

Abort while doing static initializations.

XMLWordPrintable

    • 1.1beta3
    • sparc
    • solaris_2.5, solaris_2.5.1
    • Not verified


      allan.jacobs@Eng 1996-12-19

      The following code seg faults when interpreted.

      class X1 {
        static int i1;
        static {
          i1 = X.func3();
        }
      }

      class X2 extends X1{
        static int i3;
        static{
          i3 = X.func2();
        }
      }

      class X extends X2 {
         static int check2=0;
         static int check3=0;
         static int func2() {X.check2 = 10; return 10;}
         static int func3() {X.check3 = 10; return 10;}
         public static void main(String[] arg)
          {
            System.out.println(X.check2);
            System.out.println(X.check3);
          }
      }

            nsaraiyasunw Nakul Saraiya (Inactive)
            ajacobssunw Allan Jacobs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: