JLS explanation or correction needed 7.5.3 & 7.5.4
Alex Buckley
alex.buckley at oracle.com
Wed Jun 22 23:38:19 UTC 2016
These "permissible" paragraphs do raise questions from time to time, so
I have filed https://bugs.openjdk.java.net/browse/JDK-8160131 to
clarify. Basically you have to know about the possibility of inheriting
multiple members with the same name (and in the case of methods, same
signature) from multiple supertypes, but that's not introduced until
8.3, 8.4.8, and 8.5.
Alex
On 6/12/2016 4:02 PM, Hiram Hunt wrote:
> The JLS (Java 8 SE Edition) says in section 7.5.3
>
> "It is permissible for one single-static-import
> declaration to import several fields or types
> with the same name, or several methods with the
> same name and signature."
>
> and says in section 7.5.4
>
> "It is permissible for one static-import-on-demand
> declaration to import several fields or types
> with the same name, or several methods with the
> same name and signature."
>
> My understanding is that it is not legal to declare
> several fields with the same name as members of one
> class nor several types with the same name as members
> of one class nor several methods with the same name
> _and signature_ as members of the same class. Thus,
> it is hard for me to understand the above quoted
> statements from the JLS. They need correction or
> explanation, possibly by example.
>
> -- Hiram Hunt (hiramhunt at verizon.net)
More information about the jls-jvms-spec-comments
mailing list