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

REGRESSION: import of pkg.* also imports static inner classes pkg.SomeClass.*

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • b40
    • generic, sparc
    • generic, solaris_9

      The source in the attachment CheckLayoutLTR.java fails to compile with
      recent 1.5 beta compilers because it is interpreting the import

      import java.awt.geom.*
      to automatically also act like this
      import java.awt.geom.Rectangle2D.*

      It is (applying to static inner classes-- which it didn't do before,
      introducing an ambiguity.

      % /import/java/jdk1.5/solaris-sparc/bin/java -version
      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b36)
      Java HotSpot(TM) Server VM (build 1.5.0-beta2-b36, mixed mode)
      rincewind- 255% /import/java/jdk1.5/solaris-sparc/bin/javac CheckLayoutLTR.java
      CheckLayoutLTR.java:20: reference to Float is ambiguous, both class java.lang.Float in java.lang and class java.awt.geom.Rectangle2D.Float in java.awt.geom.Rectangle2D match
              rtl.put(TextAttribute.SIZE, new Float(20));
                                              ^
      CheckLayoutLTR.java:24: reference to Float is ambiguous, both class java.lang.Float in java.lang and class java.awt.geom.Rectangle2D.Float in java.awt.geom.Rectangle2D match
              ltr.put(TextAttribute.SIZE, new Float(20));
                                              ^
      CheckLayoutLTR.java:27: reference to Float is ambiguous, both class java.lang.Float in java.lang and class java.awt.geom.Rectangle2D.Float in java.awt.geom.Rectangle2D match
              none.put(TextAttribute.SIZE, new Float(20));

            gafter Neal Gafter (Inactive)
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: