RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v32]

Jim Laskey jlaskey at openjdk.org
Mon Jun 5 12:47:23 UTC 2023


On Sat, 3 Jun 2023 01:53:41 GMT, Joe Darcy <darcy at openjdk.org> wrote:

>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update the specification for TypeElement#getQualifiedName and TypeElement#getSimpleName
>
> src/java.base/share/classes/java/lang/Class.java line 1884:
> 
>> 1882:                     reflective=true)
>> 1883:     public boolean isUnnamedClass() {
>> 1884:         return PreviewFeatures.isEnabled() && isSynthetic() && isTopLevelClass();
> 
> Please add a check for final-ness as @mlchung suggested in the other PR of the reflection changes stand-alone.

Changing

> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1379:
> 
>> 1377:          @Override @DefinedBy(Api.LANGUAGE_MODEL)
>> 1378:          public Name getSimpleName() {
>> 1379:              // return isUnnamed() ? name.subName(0, 0) /* empty name */ : name;
> 
> This line could be deleted.

Changing

> test/langtools/tools/javac/processing/model/element/TestUnnamedClass.java line 140:
> 
>> 138:         }
>> 139: 
>> 140:         if (unnamedClass.getSimpleName().isEmpty()) {
> 
> Presumably the sense of the predicates testing names needs to now be reserved due to subsequent updates to the javax.lang.model support.

True, but we should ensure that what we are shipping now does what we claim.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1218020010
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1218020222
PR Review Comment: https://git.openjdk.org/jdk/pull/13689#discussion_r1218022085



More information about the build-dev mailing list