InternalAPIsUnavailableInJava9
Anebuzelsky (Talk | contribs) m (→sun.* packages) |
Anebuzelsky (Talk | contribs) m (→com.sun.* packages) |
||
Line 209: | Line 209: | ||
|com.sun.javafx.scene.web.Debugger | |com.sun.javafx.scene.web.Debugger | ||
|- | |- | ||
- | | mkozeny@netbeans.org | + | | mentlicher@netbeans.org (mkozeny@netbeans.org) |
| | | | ||
|apisupport.feedreader | |apisupport.feedreader | ||
|com.sun.syndication.* | |com.sun.syndication.* | ||
|- | |- | ||
- | | saubrecht@netbeans.org | + | | mentlicher@netbeans.org (saubrecht@netbeans.org) |
| | | | ||
|o.n.swing.plaf | |o.n.swing.plaf |
Revision as of 11:02, 22 May 2015
Contents |
Internal JDK APIs Unavailable In Java 9
With Java 9 coming we have to prepare for several big changes which will affect NetBeans and might break the code. One such change is that bunch of internal APIs from JDK 8 and older will become really JDK internal and will not be accessible from NetBeans. Internal APIs will not be accessible when JDK 9 module boundaries will be in place. We have to therefore replace these APIs with new one. This document serves for tracking NetBeans packages which are affected, list some already published replacement/workarounds. We will use this doc to make sure NetBeans version supposed to be running on Java 9 will be ready on time re internal API usage.
jdeps tool
We used jdeps tool to search for what Java internal APIs we are using. It lists also some examples how to replace obsolete internal APIs with new public ones. It is recommended that every NetBeans module developer runs jdeps on his modules and does not depend solely on this table.
sun.* packages
APIs under sun.* will be Java private one and will not be accessible from within NetBeans sources. Here is the list of NetBeans modules and what sun.* packages were found.
Owner | Resolved/Comment | NetBeans module | Internal Java API being used |
---|---|---|---|
mromashova@netbeans.org | dlight.remote | sun.awt.shell.ShellFolder, sun.swing.FilePane, un.swing.WindowsPlacesBar | |
phejl@netbeans.org | glassfish.common | sun.misc.BASE64Encoder, sun.net.NetProperties | |
phejl@netbeans.org | web.jspparser | sun.misc.SharedSecrets, sun.misc.ClassLoaderUtil | |
thurka@netbeans.org | jconsole | sun.jvmstat.monitor.*, sun.management.ConnectorAddressLink, sun.tools.jconsole.JConsole | |
thurka@netbeans.org | lib.profiler | sun.jvmstat.monitor.* | |
thurka@netbeans.org | profiler.heapwalker | sun.misc.VM | |
thurka@netbeans.org | profiler.snaptracer | sun.swing.plaf.synth.SynthIcon | |
thurka@netbeans.org | lib.profiler.charts | sun.swing.SwingUtilities2 | |
thurka@netbeans.org | profiler.oql | sun.misc.Ref | |
thurka@netbeans.org | sampler | sun.management.ThreadInfoCompositeData | |
thurka@netbeans.org | traceio | sun.misc.IoTrace | |
mentlicher@netbeans.org | debugger.jpda | sun.reflect.DelegatingClassLoader, sun.font.AttributeMap, sun.reflect.ReflectionFactory, sun.awt.X11.XAwtState, sun.awt.X11.XBaseWindow, sun.awt.X11.XToolkit, sun.awt.X11.XAtom | |
mentlicher@netbeans.org | debugger.jpda.visual | sun.misc.Launcher$AppClassLoader | |
tstupka@netbeans.org | kenai | sun.misc.BASE64Encoder | |
tmysik@netbeans.org | php.dbgp | sun.misc.BASE64Encoder | |
mentlicher@netbeans.org (ovrabec@netbeans.org) | o.n.swing.dirchooser | sun.awt.shell.ShellFolder | |
mentlicher@netbeans.org (ovrabec@netbeans.org) | o.n.swing.dirchooser | sun.swing.WindowsPlacesBar, sun.awt.shell.ShellFolder | |
mentlicher@netbeans.org (ovrabec@netbeans.org) | openide.util | sun.awt.AppContext | |
mentlicher@netbeans.org (jpeska@netbeans.org) | openide.explorer | sun.beans.editors.EnumEditor | |
mentlicher@netbeans.org (jhavlin@netbeans.org) | openide.filesystems | sun.security.tools.KeyTool, sun.security.tools.JarSigner | |
lfischmeistr@netbeans.org | core.network | sun.net.spi.DefaultProxySelector, sun.net.NetProperties | |
lfischmeistr@netbeans.org | o.n.bootstrap | sun.awt.AppContext | |
mentlicher@netbeans.org (saubrecht@netbeans.org) | core.windows | sun.awt.X11.XToolkit, sun.awt.X11.XWM, sun.swing.plaf.synth.SynthIcon | |
mentlicher@netbeans.org (saubrecht@netbeans.org) | o.n.swing.plaf | sun.swing.plaf.synth.SynthUI | |
mmetelka@netbeans.org | editor | sun.awt.AppContext | |
mmetelka@netbeans.org | openide.text | sun.awt.im.InputContext, sun.awt.im.InputMethodContext | |
mkristofic@netbeans.org | spi.editor.hints | sun.swing.plaf.synth.SynthIcon |
com.sun.* packages
Some packages from com.sun will become public API in Java 9. These are:
- com.sun.source.*
- com.sun.jdi
- com.sun.tools.javac.* is exported, subpackages will be internal
As the source of intermediate info about what packages will be exported from Java 9 you can refer to modules.xml for Java 9 modules being API. This info/mechanism can change (modules.xml can be replaced by something different) once Java 9 implementation proceeds further to Feature complete and release. Following table lists NetBeans modules which utilizes com.sun.* internal APIs which will be internal in Java 9. com.sun.source usage and com.sun.jdi usage were removed from this list.
Owner | Resolved/Comment | NetBeans module | Internal Java API being used |
---|---|---|---|
petrk@netbeans.org | cnd.modelimpl | com.sun.org.apache.xerces.*, com.sun.org.apache.xml.* | |
phejl@netbeans.org | web.el | com.sun.el.parser.* | |
phejl@netbeans.org | web.jsf.editor | com.sun.faces.* | |
thurka@netbeans.org | jconsole | com.sun.jmx.* | |
mentlicher@netbeans.org | debugger.jpda.visual | com.sun.media.jfxmedia.* | |
mentlicher@netbeans.org | debugger.jpda.visual | com.sun.javafx.runtime.* | |
mentlicher@netbeans.org | debugger.jpda.visual | com.sun.javafx.tk.* | |
jstola@netbeans.org | websvc.* | com.sun.tools.ws.*, com.sun.xml.ws.*, com.sun.xml.rpc.* | |
jstola@netbeans.org | core.browser.webview | com.sun.javafx.scene.web.Debugger | |
mentlicher@netbeans.org (mkozeny@netbeans.org) | apisupport.feedreader | com.sun.syndication.* | |
mentlicher@netbeans.org (saubrecht@netbeans.org) | o.n.swing.plaf | com.sun.java.swing.plaf.gtk.GTKLookAndFeel, com.sun.java.swing.plaf.windows.WindowsLookAndFeel | |
lfischmeistr@netbeans.org | o.n.bootstrap | com.sun.jnlp.JNLPClassLoader | |
lfischmeistr@netbeans.org | core.startup | com.sun.java.swing.plaf.gtk.GTKLookAndFeel, com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel, com.sun.java.swing.plaf.windows.WindowsLookAndFeel | |
sdedic@netbeans.org | java.source | com.sun.tools.javac.* - Listed for completness, nbjavac contains this. (only this package exported, subpackages are not) | |
rsvitanic@netbeans.org | deployment.deviceanywhere | com.sun.xml.stream.ZephyrParserFactory | |
mbalin@netbeans.org | javacard.* | com.sun.javacard.* | |
identity.profile.api | com.sun.identity.* |
Reflection
It should be be possible to use reflection to call Java internal APIs even after module boundaries will be in place. It will be likely necessary to call setAccessible(true) for elements which needs to be called via reflection. At this moment it is not 100% confirmed it will work this way or setAccessible(true) will be needed.