RFR: 8241151: Incorrect lint warning for no definition of serialVersionUID in a record [v2]

Jonathan Gibbons jonathan.gibbons at oracle.com
Tue Sep 29 22:29:01 UTC 2020


Yes, Boolean.getBoolean could have been used, but to be accurate, the 
behavior is not identical, and given this is just test code that has 
already been integrated, I don't see the point in changing it.

-- Jon

On 9/29/20 3:16 PM, PROgrm_JARvis wrote:
> On Tue, 29 Sep 2020 16:03:37 GMT, Vicente Romero <vromero at openjdk.org> wrote:
>
>>> test/langtools/tools/javac/records/RecordCompilationTests.java line 151:
>>>
>>>> 149:
>>>> 150:     public RecordCompilationTests() {
>>>> 151:         useAP = System.getProperty("useAP", "false").equals("true");
>>> Can't `Boolean.getBoolean("useAP")` be used here instead?
>> it could be used, but the test could potentially be executed from command line too and there is no guarantee that the
>> system property will be there if executed from the command line
> As I understand, call to `Boolean.getBoolean("useAP")` is identical to your variant as it also relies on
> `System#getProperty(String)` so I cannot see any different behaviour if using it:
> https://github.com/openjdk/jdk/blob/8df3e72cea9217a7a10e2ac4bf4d1501a7fad43c/src/java.base/share/classes/java/lang/Boolean.java#L272-L279
>
> -------------
>
> PR: https://git.openjdk.java.net/jdk/pull/363


More information about the compiler-dev mailing list