RFR: JDK-8296743: Tighten Class.getModifiers spec for array classes

Joe Darcy darcy at openjdk.org
Fri Nov 18 17:39:23 UTC 2022


On Fri, 18 Nov 2022 15:47:37 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:

>> Update the spec of Class.getModifiers to match long-standing behavior for primitive and array classes. Remove unneeded implementation flexibility with regard to setting other bit positions. This work was prompted to better support anticipated future Valhalla changes.
>> 
>> Please also review the CSR: https://bugs.openjdk.org/browse/JDK-8297237
>
> src/java.base/share/classes/java/lang/Class.java line 1306:
> 
>> 1304:      *      {@code true}
>> 1305:      * <li> its interface modifier is always {@code false}, event when
>> 1306:      *      the component type is an interface
> 
> Should this mention that all array classes will also have their `abstract` modifier set?  The test cases seem to confirm that it's expected but we haven't stated it explicitly here.

Yes -- good catch. Adding "abstract" got lost in an edit; I'll update the patch and CSR accordingly.

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

PR: https://git.openjdk.org/jdk/pull/11229


More information about the core-libs-dev mailing list