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

compiler error messages sorting order is not stable

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: laC46010 Date: 10/17/96


      In some cases compiler sorts its error messages differently
      for the same source files. It seems it may depends on
      some external reasons such as CLASSPATH value for example.

      Such undeterministic behaviour of the compiler prevents
      its testing using "golden" files.

      A log below shows that an error message for "clss00403_a.java"
      is reported first in order when CLASSPATH si not set and
      as second when CLASSPATH is set.

      The same undeterministic behaviour can be seen also running
      other JCK's test case: "intf00403".

      ----------------------------log-----------------------------------------------
      /export/ld32/leo/bugs/clss00403_39 unsetenv CLASSPATH
      /export/ld32/leo/bugs/clss00403_40 /export/ld32/jdk_1.1/bin/javac -d . clss00403_a.java clss00403.java
      clss00403_a.java:11: Class javasoft.sqe.tests.lang.clss004.clss00403.PointColor not found in type declaration.
              PointColor color; // color of this point
                              ^
      clss00403.java:11: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
              Point first; // first point with this color
                         ^
      clss00403.java:22: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
      Point p = new Point();
      ^
      clss00403.java:22: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
      Point p = new Point();
      ^
      4 errors
      /export/ld32/leo/bugs/clss00403_41 setenv CLASSPATH /export/ld32/leo/bugs/clss00403:.
      /export/ld32/leo/bugs/clss00403_42 /export/ld32/jdk_1.1/bin/javac -d . clss00403_a.java clss00403.java
      clss00403.java:11: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
              Point first; // first point with this color
                         ^
      clss00403_a.java:11: Class javasoft.sqe.tests.lang.clss004.clss00403.PointColor not found in type declaration.
              PointColor color; // color of this point
                              ^
      clss00403.java:22: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
      Point p = new Point();
      ^
      clss00403.java:22: Class javasoft.sqe.tests.lang.clss004.clss00403.points.Point not found in type declaration.
      Point p = new Point();
      ^
      4 errors
      ------------------end of log-----------------------------------------------

      --------------------------clss00403_a.java------------------------------
      // Ident: @(#)clss00403_a.java 1.2 96/08/20
      // Copyright 08/20/96 Sun Microsystems, Inc. All Rights Reserved

      package javasoft.sqe.tests.lang.clss004.clss00403;

      // example from Java specification, 8.1.1
      // but class PointColor is in a separate compilation unit

      class Point {
              int x, y; // coordinates
              PointColor color; // color of this point
              Point next; // next point with this color
              static int nPoints;
      }
      -----------------------------------------------------------------

      --------------------------clss00403.java------------------------------
      // Ident: @(#)clss00403.java 1.3 96/09/02
      // Copyright 09/02/96 Sun Microsystems, Inc. All Rights Reserved

      package javasoft.sqe.tests.lang.clss004.clss00403.points;
      import java.io.PrintStream;

      // example from Java specification, 8.1.1
      // but class Point is in a separate compilation unit

      class PointColor {
              Point first; // first point with this color
              PointColor(int color) { this.color = color; }
              private int color; // color components
      }

      public class clss00403 {
        public static void main(String argv[])
        {
           System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
        }
        public static int run(String argv[], PrintStream out) {
      Point p = new Point();
      PointColor pc = new PointColor(1);
      p.color = pc;
      pc.first = p;
              return 0;
        }
      }

      -----------------------------------------------------------------

      ======================================================================

            gafter Neal Gafter (Inactive)
            leosunw Leo Leo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: