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)
======================================================================
- duplicates
-
JDK-4091687 Problem in imports with recursive compilation
- Closed