blob: 4c4e88013bfeed2b75967d2f1445913ac347fba3 [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqDependOnCore
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqDependOnCore
:description: Apache NetBeans wiki DevFaqDependOnCore
:toc: left
:toc-title:
:syntax: true
=== 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, link:http://www.netbeans.org/issues/enter_bug.cgi[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).
Anything under `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 (link:DevFaqImplementationDependency.asciidoc[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.
<hr/>
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 link:http://wiki.netbeans.org/DevFaqDependOnCore[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.