RFR: 8257512: Remove use of deprecated primitive constructors in JavaFX [v3]

Ambarish Rapte arapte at openjdk.java.net
Thu Mar 11 07:37:08 UTC 2021


On Thu, 11 Mar 2021 00:29:41 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Ambarish Rapte has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   correct Float.valueOf()
>
> modules/javafx.graphics/src/main/java/com/sun/prism/es2/X11GLFactory.java line 171:
> 
>> 169:         deviceDetails.put("XVisualID", Long.valueOf(nGetVisualID(nativeCtxInfo)));
>> 170:         deviceDetails.put("XDisplay", Long.valueOf(nGetDisplay(nativeCtxInfo)));
>> 171:         deviceDetails.put("XScreenID", Integer.valueOf(nGetDefaultScreen(nativeCtxInfo)));
> 
> Autobox?

I think the statements look more readable the way they are.
The type of LHS of the expression is Object, so a reader will have to find return type of those methods to understand what type of Object gets created. I think such calls which use a return value from a method should use explicit calls. 
But then on other side in case if return type of the method is changed, then we need to also change these explicit calls.
Sounds like a decision to make for other time. What do you think  ?

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

PR: https://git.openjdk.java.net/jfx/pull/423


More information about the openjfx-dev mailing list