On Fri, 7 Feb 2020 12:32:26 GMT, Ambarish Rapte <ara...@openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/pisces/JavaSurface.java line 
>> 46:
>> 
>>> 45:         initialize(dataType, width, height);
>>> 46:         addDisposerRecord();
>>> 47:     }
>> 
>> Should this be called from the superclass instead? It works as-is, but if 
>> there were ever another subclass added, it would have to be replicated there 
>> as well.
> 
> `AbstractSurface.nativePtr` is needed to create the 
> `AbstractSurfaceDisposerRecord`.
> It is created and set by the native method `initialize(dataType, width, 
> height);` invoked at line 45 in the `JavaSurface` constructor.
> It is the reason `addDisposerRecord()` is needed here.

Oh, I see. The native initialize method in the subclass is writing into a 
private field in the superclass. Can you add a comment to this effect, since it 
isn't obvious without reading the native code?

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

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

Reply via email to