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

Problem in imports with recursive compilation

XMLWordPrintable

    • x86, sparc
    • solaris_2.5.1, windows_nt

      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.
      //###@###.###

            wmaddoxsunw William Maddox (Inactive)
            ggrahamsunw Gregory Graham (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: