RFR: JDK-8247849: permits clause of sealed interfaces should not allow parameterized types

Vicente Romero vicente.romero at oracle.com
Thu Jun 18 23:15:07 UTC 2020


Hi Jan,

On 6/18/20 4:04 PM, Jan Lahoda wrote:
> Hi Vicente,
>
> Overall looks good to me. My only comment for JavacParser is that 
> maybe we could pass the string "class"/"interface" to the 
> permitsClause method, instead of the boolean, although I do not feel 
> strongly about that.

sure will do

>
> In tests, in the second part that should verify that primitive types 
> are not allowed, should there be the '#' markers instead of "Sub[]" in 
> e.g.:
> sealed class C<T> permits Sub[] {}
> =>
> sealed class C<T> permits # {}

sure, I rushed it sorry,

> ;;
>
> (Tests for arrays of primitive types might also be included, for good 
> measure.)

ok

>
> Jan

Vicente
>
> On 18. 06. 20 19:33, Vicente Romero wrote:
>> Please review fix for [1] at [2]. I forgot to check that the 
>> `permits` clause of interfaces can't list any parameterized type, 
>> which is already done for classes. Now I have extracted the common 
>> code for classes and interfaces, the one that takes care of the 
>> `permits` clause, to avoid this kind of issues in the future,
>>
>> Thanks,
>> Vicente
>>
>> [1] https://bugs.openjdk.java.net/browse/JDK-8247849
>> [2] http://cr.openjdk.java.net/~vromero/8247849/webrev.00/



More information about the compiler-dev mailing list