In the case of a package that contains several files, during the recursive
compilation from the top-most class, if a class (for instance PrintStream) is
used but not imported properly the first time, then this class is definitely
recognized to be a class of my package. The subsequent uses of this class
in other files, with proper imports, will fail.
===================================
Nov/07/97 ###@###.###
From the email corespodence:
This is the test case:
--- test/Top.java---
package test;
class Top
{
PrintStream stream;
Interm o1;
Leaf o2;
};
--- test/Interm.java---
package test;
class Interm
{
PrintStream stream;
};
--- test/Leaf.java---
package test;
import java.io.*;
class Leaf
{
PrintStream stream;
};
solaris> javac test/Top.java causes the outputs:
test/Top.java:5: Class test.PrintStream not found in type declaration.
PrintStream stream;
^
./test/Interm.java:5: Class test.PrintStream not found in type
declaration.
PrintStream stream;
^
./test/Leaf.java:6: Class test.PrintStream not found in type
declaration.
PrintStream stream;
^
3 errors
==============================
This type of error messages may confuse the developers.
//###@###.###
compilation from the top-most class, if a class (for instance PrintStream) is
used but not imported properly the first time, then this class is definitely
recognized to be a class of my package. The subsequent uses of this class
in other files, with proper imports, will fail.
===================================
Nov/07/97 ###@###.###
From the email corespodence:
This is the test case:
--- test/Top.java---
package test;
class Top
{
PrintStream stream;
Interm o1;
Leaf o2;
};
--- test/Interm.java---
package test;
class Interm
{
PrintStream stream;
};
--- test/Leaf.java---
package test;
import java.io.*;
class Leaf
{
PrintStream stream;
};
solaris> javac test/Top.java causes the outputs:
test/Top.java:5: Class test.PrintStream not found in type declaration.
PrintStream stream;
^
./test/Interm.java:5: Class test.PrintStream not found in type
declaration.
PrintStream stream;
^
./test/Leaf.java:6: Class test.PrintStream not found in type
declaration.
PrintStream stream;
^
3 errors
==============================
This type of error messages may confuse the developers.
//###@###.###
- duplicates
-
JDK-4185330 If class resolution fails in one file, retry resolution step in subsequent files
- Closed
- relates to
-
JDK-4185328 Missing import can cause unpredictable errors in other files.
- Closed