RFR: 8347471: Provide valid flags and mask in AccessFlag.Location [v8]

Chen Liang liach at openjdk.org
Sun Apr 27 17:31:47 UTC 2025


On Sun, 27 Apr 2025 16:47:59 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Chen Liang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix iterator missing NSEE
>
> src/java.base/share/classes/java/lang/reflect/AccessFlag.java line 722:
> 
>> 720:     }
>> 721: 
>> 722:     private static final class AccessFlagSet extends AbstractSet<AccessFlag> {
> 
> This should probably also define the spliterator method:
> 
> @Override
> public Spliterator<AccessFlag> spliterator() {
> 	return Spliterators.spliterator(
> 		this,
> 		Spliterator.DISTINCT	| Spliterator.ORDERED	| Spliterator.SIZED
> 		| Spliterator.NONNULL	| Spliterator.IMMUTABLE	| Spliterator.SUBSIZED
> 	);
> }

Hmm, I intentionally avoided implementing spliterator because there are too many opportunities to optimize - a fully optimized Spliterator implementaton should split an int mask. Can we do that in another patch? I need to check if MOAT tests spliterators too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23095#discussion_r2062683681


More information about the core-libs-dev mailing list