RFR: JDK-8133616: compiler error messages for dup single type, single static import switched

Jan Lahoda jan.lahoda at oracle.com
Fri Nov 24 18:03:04 UTC 2017


Hi,

Consider code like this:
---
import java.awt.geom.Line2D.Double;
import static java.awt.geom.Path2D.Double;
---

Compiling it produces this error:
---
$ javac Test.java
Test.java:2: error: a type with the same simple name is already defined 
by the static single-type-import of Double
import static java.awt.geom.Path2D.Double;
^
1 error
---

This sounds like the first import is a static import, which is not the 
case. The proposal is to keep better track of the original import kind 
and report static/non-static more appropriately.

Bug: https://bugs.openjdk.java.net/browse/JDK-8133616
Webrev: http://cr.openjdk.java.net/~jlahoda/8133616/webrev.00/

How does it look?

Thanks,
     Jan


More information about the compiler-dev mailing list