RFR: 8254569: Remove hard dependency on Dispman in Monocle fb rendering [v4]
Kevin Rushforth
kcr at openjdk.java.net
Thu Nov 5 13:41:56 UTC 2020
On Thu, 5 Nov 2020 13:34:40 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/com/sun/glass/ui/monocle/EGLAcceleratedScreen.java line 46:
>>
>>> 44: */
>>> 45: EGLAcceleratedScreen(int[] attributes) throws GLException {
>>> 46: eglWindowHandle = platformGetNativeWindow();
>>
>> My IDE flags this line with "Overridable method call in constructor" (Item 19 in Bloch's *Effective Java Third Edition*): "the overriding method in the subclass will get invoked before the subclass constructor has run."
>
> We can make this private, but that would give a wrong sense of security, as the native method can still be implemented in different ways.
> @kevinrushforth Do we have the policy of not using overridable method calls in constructors?
We do this in other places as well. It needs to be considered carefully, but in this case seems reasonable to do as long as the subclass doesn't rely on anything initialized in its constructor.
-------------
PR: https://git.openjdk.java.net/jfx/pull/343
More information about the openjfx-dev
mailing list