JDK 12 RFR of JDK-8206085 : Refactor langtools/tools/javac/versions/Versions.java

Peter Levart peter.levart at gmail.com
Mon Jul 2 14:36:58 UTC 2018


Hi Joe,

A suggestion for more compact code: the (ever growing) switch statement 
in enum SourceTarget.checksrc could be replaced with a field of type 
BiConsumer<Versions, String[]>, initialized in constructor. For each 
enum constant you then just pass a method reference to the chosen target 
method. The checksrc in SourceTarget could be an instance method.

Peter

On 06/29/2018 09:41 PM, joe darcy wrote:
> Dis-charged revision along with JDK 11 specific source example now up at
>
>     http://cr.openjdk.java.net/~darcy/8206085.1/
>
> Thanks,
>
> -Joe
>
>
> On 6/29/2018 9:55 AM, Jonathan Gibbons wrote:
>> There's more static in this file than on my high-school Van de Graaf 
>> generator!
>>
>> Can we follow the convention of creating an instance in main, and 
>> then using instance methods.
>>
>> The naming of some methods is also novel, with respect to 
>> case-conventions.
>>
>> -- Jon
>>
>>
>> On 6/28/18 8:15 PM, joe darcy wrote:
>>> Hello,
>>>
>>> Fresh off of updating
>>>
>>>     langtools/tools/javac/versions/Versions.java
>>>
>>> for the JDK 11 -> 12 transition, I'd like to refactor the test to 
>>> reduce the maintenance needed when adding new versions (as in new 
>>> releases) or removing versions (as is planned for later in JDK 12):
>>>
>>>     http://cr.openjdk.java.net/~darcy/8206085.0/
>>>
>>> Thanks,
>>>
>>> -Joe
>>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20180702/e60a02ba/attachment.html>


More information about the compiler-dev mailing list