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

javac fails to report ambiguous class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • 1.3.0
    • tools
    • generic
    • solaris_7

      javac 1.3 fails to report ambiguous class as javac 1.2 did:

      =======================
      foo/FileSystem.java
      =======================
      package foo;

      public class FileSystem {
      }


      =======================
      Test.java
      =======================
      import java.io.*;
      import foo.*; // This is ambiguous
      //import foo.FileSystem;// This is not ambiguous

      public class Test {
          public void someMethod(FileSystem f) {
          }
      }



      javac 1.2 reports the following error when compiling Test:
      danmark[929] javac12 foo/FileSystem.java
      danmark[930] javac12 Test.java
      Test.java:6: Ambiguous class: java.io.FileSystem and foo.FileSystem
          public void someMethod(FileSystem f) {
                      ^
      1 error
      danmark[931]


      javac 1.3 doesn't report the error.

      If the import statement is changed to 'import foo.FileSystem;', neither compiler reports error.

            wmaddoxsunw William Maddox (Inactive)
            tpreisle Thomas Preisler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: