Note: These pages are being reviewed.
There is a class under org.netbeans.core that does what I need. Can I call/use/depend on it?
No. Not if you want your module to work in the future. Copy the code instead. If it is a thing that seems generally useful, file an enhancement request requesting an API for the thing you need to do (and make sure there isn’t already a supported way to do it).
org.netbeans.core is non-public, not an API, and subject to change without notice. An API is a contract - an agreement about compatibility. There is no such contract for this namespace, under any circumstances. The class or method you are using may not even exist in the future. Depend on it at your peril.
A perfect example of why not to do this is JProfiler’s plugin for NetBeans - it broke very badly across releases because it needlessly depended on the implementation of
DialogDisplayer rather than on the API class - so when that class moved, it could no longer link, so the module didn’t work.
If you really must use some non-API classes to do what you need to do, use an implementation dependency (DevFaqImplementationDependency) - your module probably won’t load in any version except the one it was built against, but at least your users won’t get nasty surprises. And ideally, notify the maintainer of the thing you’re depending on - they can give you a heads-up if they think they’re about to make a change that will break your module.
Applies to: NetBeans 6.8 and above
Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqDependOnCore , that was last modified by NetBeans user Jglick on 2010-06-14T20:12:01Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.