The closed API of Java2D/AWT which is currently used by JOGL

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

The closed API of Java2D/AWT which is currently used by JOGL

Sergey Bylokhov
Hello, Everybody.

I working on a Java2D/AWT part of the OpenJDK project and would like to
know which part of the closed API is still used by the  JOGL project. I found
a few places where "sun.java2d.opengl.OGLUtilities" is used, but if I remove
this class from the JDK the JOGL seems still continue work.

If debug mode is enabled then I see some related exceptions like:
java.lang.NoSuchFieldException: PBUFFER
        at java.base/java.lang.Class.getField(Class.java:2000)
        at jogamp.opengl.awt.Java2D$2.run(Java2D.java:574)
        at jogamp.opengl.awt.Java2D$2.run(Java2D.java:569)

see https://bugs.openjdk.java.net/browse/JDK-7188942

Exception in thread "main" java.lang.NoSuchMethodError: 'java.awt.peer.ComponentPeer com.jogamp.opengl.awt.GLCanvas.getPeer()'
        at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:632)
        at java.desktop/java.awt.Container.addNotify(Container.java:2800)
        at java.desktop/java.awt.Window.addNotify(Window.java:777)

see https://bugs.openjdk.java.net/browse/JDK-8074028

Does it mean that JOGL running on jdk11+  does not use OGLUtilities class?
Reply | Threaded
Open this post in threaded view
|

Re: The closed API of Java2D/AWT which is currently used by JOGL

Sven Gothel
Administrator
Should be all resolved,
please see the thread 'java11 + release progress thread (also: review)'.

You will find a java11 branch and respective bugzilla entries.

~Sven

On 9/21/19 6:49 AM, Sergey Bylokhov [via jogamp] wrote:

> Hello, Everybody.
>
> I working on a Java2D/AWT part of the OpenJDK project and would like to
> know which part of the closed API is still used by the  JOGL project. I found
> a few places where "sun.java2d.opengl.OGLUtilities" is used, but if I remove
> this class from the JDK the JOGL seems still continue work.
>
> If debug mode is enabled then I see some related exceptions like:
> java.lang.NoSuchFieldException: PBUFFER
>         at java.base/java.lang.Class.getField(Class.java:2000)
>         at jogamp.opengl.awt.Java2D$2.run(Java2D.java:574)
>         at jogamp.opengl.awt.Java2D$2.run(Java2D.java:569)
>
> see https://bugs.openjdk.java.net/browse/JDK-7188942
>
> Exception in thread "main" java.lang.NoSuchMethodError:
> 'java.awt.peer.ComponentPeer com.jogamp.opengl.awt.GLCanvas.getPeer()'
>         at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:632)
>         at java.desktop/java.awt.Container.addNotify(Container.java:2800)
>         at java.desktop/java.awt.Window.addNotify(Window.java:777)
>
> see https://bugs.openjdk.java.net/browse/JDK-8074028
>
> Does it mean that JOGL running on jdk11+  does not use OGLUtilities class?
>
Reply | Threaded
Open this post in threaded view
|

Re: The closed API of Java2D/AWT which is currently used by JOGL

Sergey Bylokhov
I found the patch below, which just replaces reflection by the hard-coded types.
https://jogamp.org/cgit/jogl.git/commit/?h=java11&id=e1c8add69973b0eae9a87cf2181a0f1cbbe62f4b

But it does not clear is this class is used for something, we do some cleanup of the Java2D related code and classes like sun.java2d.opengl.OGLUtilities(any other usage of the methods) have a good chance to be removed as they are not a public API(I am talking about some future jdk, in jdk11 it will be removed)

Probably this functional might be implemented differently? For example, it should be possible to expose such things via JAWT. I suggest to file a bug against OpenJDK/Java2D and of course, any patches/contributions are welcome.
Reply | Threaded
Open this post in threaded view
|

Re: The closed API of Java2D/AWT which is currently used by JOGL

Sergey Bylokhov
TYPO: in the jdk11 it will NOT be removed.