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

Problem in imports with recursive compilation

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris_2.5.1, windows_nt

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: