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

If class resolution fails in one file, retry resolution step in subsequent files

XMLWordPrintable

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



      Name: wm38563 Date: 10/28/98


      Consider the following two classes:

      Test.java
      ---
      package test;

      import java.util.*;

      public class Test {
      public static void main(String[] args) {
      System.out.println(Locale.US);
      }
      }

      Test2.java
      ---
      package test;
      //import java.util.*;
      class Test2 {
      Locale locale = null;
      }

      Issuing the command "javac test\Test.java test\Test2.java"
      results in a single compiler error in Test2, line 6.
      "Class test.Locale not found". If, however, you issue the
      command "javac test\Test2.java test\Test.java" you get
      three errors, the correct Test2 line 6 error, and two spurious
      errors in Test, line 7 -- "Class test.Locale not found" and
      "Undefined variable or class name: Locale". Clearly, the
      order of compilation should not effect the validity of the code.

      If a class resolution fails in the one file, it should retry the class
      resolution step in subsequent ones. It certainly should not spit
      out an incorrect error message.
      (Review ID: 40078)
      ======================================================================

            tturnidgsunw Todd Turnidge (Inactive)
            wmaddoxsunw William Maddox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: