JDK 14 RFR of JDK-8233096: Update javax.lang.model for switch expressions

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Nov 13 22:49:34 UTC 2019


OK.

While there is still some repeated code, most notably with respect to 
isKeyword and isKeywordVersion, I realize these are the methods being 
tested, and should not be oversimplified.

-- Jon


On 11/12/2019 07:50 PM, Joe Darcy wrote:
> Hi Jon,
>
> Re-refactored test to cut down on code duplication:
>
>     http://cr.openjdk.java.net/~darcy/8233096.2/
>
> Cheers,
>
> -Joe
>
> On 11/12/2019 5:43 PM, Jonathan Gibbons wrote:
>> Hi Joe,
>>
>> There seems to be a lot of repeated code in the test, perhaps because 
>> it has been slowly growing over the years.
>>
>> It might be worth considering using an enum to encapsulate the 
>> properties/predicate/name of "keyword" vs "name".
>>
>> It also seems like the check calls always come in pairs for 
>> true/false for the first argument. In conjunction with the previous 
>> suggestion, this could maybe be simplified as well.
>>
>> -- Jon
>>
>> On 11/12/19 3:37 PM, Joe Darcy wrote:
>>>
>>> Coming back to this after the switch expression changes were pushed, 
>>> I've updated the test to give a more informative output message on 
>>> an error:
>>>
>>> http://cr.openjdk.java.net/~darcy/8233096.1/
>>>



More information about the compiler-dev mailing list