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

Package observability ascertainment still depends on side effects.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 5.0, 6, 7, 8, 9
    • tools
    • None
    • generic
    • generic

      This simple one line java program triggers an error from the compiler:

      import javax.*;

      /home/srikanth/tmp/X.java:1: error: package javax does not exist
      import javax.*;
      ^

      This is confusing, since the following will compile just fine:

      // ---
      import javax.*;
      import javax.swing.*;
      // --

      So will the following:
      // ---
      import javax.swing.*;
      import javax.*;
      // --

      https://bugs.openjdk.java.net/browse/JDK-4869999 made the compiler insensitive to the order
      of import statements, but the compiler is still relying on "side effects" for determining the observability of
      packages.

      Using the recursive version of JFM's list() should help here.

            sadayapalam Srikanth Adayapalam (Inactive)
            sadayapalam Srikanth Adayapalam (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: