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

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Nov 27 11:19:40 UTC 2017


Looks good

Thanks
Maurizio


On 24/11/17 18:03, Jan Lahoda wrote:
> 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