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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b40
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_9

      Description

      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));

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gafter Neal Gafter
              Reporter:
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: