Introduction

This document lists changes made to the Java Support APIs. Please ask on the dev@java.netbeans.org or nbdev@netbeans.org mailing list if you have any questions about the details of a change, or are wondering how to convert existing code to be compatible.


Index of APIs

Incompatible changes by date

Fuller descriptions of all changes can be found below (follow links).

Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.

All changes by date

Changes by version

These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:

OpenIDE-Module-Module-Dependencies: org.netbeans.api.java/1 > 1.20

Changes by affected class

org.netbeans.api.java.queries.AnnotationProcessingQuery

org.netbeans.spi.java.queries.AnnotationProcessingQueryImplementation

org.netbeans.api.java.classpath.JavaClassPathConstants

org.netbeans.api.java.queries.SourceJavadocAttacher

org.netbeans.spi.java.queries.SourceJavadocAttacherImplementation

org.netbeans.api.java.queries.SourceLevelQuery

org.netbeans.spi.java.queries.SourceLevelQueryImplementation2


Details of all changes by API and date


Classpath API

Introducing JavaClassPathConstants.COMPILE_ONLY

May 23 '12; API spec. version: 1.39; affected top-level classes: JavaClassPathConstants; made by: tzezula; issues: #207717

Added a new COMPILE_ONLY classpath type allowing project types to add classpath resources which should be included in the complile classpath but should not be inherited by runtime classpath.

Introducing AnnotationProcessingQuery.Result.Trigger

Apr 15 '10; API spec. version: 1.28; affected top-level classes: AnnotationProcessingQuery; made by: dbalek; issues: #183793

Modifying AnnotationProcessingQuery.Result.annotationProcessingEnabled() to return a set of triggers on which the annotation processors should be run.

Introducing AnnotationProcessingQuery.Result.processorOptions

Mar 4 '10; API spec. version: 1.26; affected top-level classes: AnnotationProcessingQuery; made by: dbalek; issues: #181421

Adding AnnotationProcessingQuery.Result.processorOptions() to return options passed to annotation processors (-Akey=value).

Introducing AnnotationProcessingQuery

Jan 27 '10; API spec. version: 1.25; affected top-level classes: AnnotationProcessingQuery AnnotationProcessingQueryImplementation; made by: jlahoda; issues: #179749

Adding AnnotationProcessingQuery return annotation processing options for a given file/folder.

Introducing JavaClassPathConstants.PROCESSOR_PATH

Oct 18 '09; API spec. version: 1.22; affected top-level classes: JavaClassPathConstants; made by: jlahoda; issues: #174202

Class org.netbeans.api.java.classpath.JavaClassPathConstants is created to hold java specific classpath constants. org.netbeans.api.java.classpath.JavaClassPathConstants.PROCESSOR_PATH constant is created as a key for Java processor path.

Splitting the java API to independent ClassPath API and the rest of the java API

Jun 5 '08; API spec. version: 1.18; made by: tzezula; issues: #136169

The copy of the ClassPath API was used by generic scripting framework, which cannot depend on the java cluster. To remove this copy of the ClassPath API the java API needs to be splitted into the ClassPath API (IDE cluster) and the rest of the java API (java cluster).


Binary-compatible

Interconversions with string-format classpaths

Mar 17 '08; API spec. version: 1.15; made by: jglick; issues: #59311

ClassPath.toString(PathConversionMode) and ClassPathSupport.createClassPath(String) can be used to easily convert between traditional string classpaths and NetBeans' internal representation.

Support for specifying classpath inclusion

Mar 1 '07; API spec. version: 1.13; made by: jglick; issues: #49026

Classpath implementations can now specify which files and folders/packages to include or exclude. (This could be used for binary classpaths such as COMPILE but currently only excludes on SOURCE paths are honored by Java language features.)


Compatibility:

It is possible for clients of existing ClassPath methods to have made assumptions about their behavior that are no longer true.

ClassPath API changed to be pluggable and better support build system

Mar 16 '04; API spec. version: 1.4; made by: jglick

ClassPath is now final, not abstract. (Not incompatible, since the constructor was never public.) Same for ClassPath.Entry.

getClassPath now looks for ClassPathProviders rather than delegating to the filesystems mounted in Repository.

The classpath type DEBUG was deprecated. SOURCE and BOOT were added.

ClassPath.Entry.getURL() was added.

There is a complete SPI for creating ClassPath instances.


Compatibility:

Code which just called ClassPath.getClassPath and so on as API clients should still be safe, but passing null as a reference file no longer works.

Added GlobalPathRegistry

Mar 16 '04; API spec. version: 1.4; made by: jglick
Added a new class GlobalPathRegistry to represent classpaths of current interest, typically from open projects.
Compatibility:

Note that GlobalPathRegistry serves some of the same functions as Repository.default used to, but client code should be reviewed carefully for usage.

ClassPath.getClassLoader method added

Feb 21 '03; API spec. version: 1.2.1; made by: sdedic
ClassPath.getClassLoader() method allows to get classloader capable of loading classes from the ClassPath.

ClassPath.getClassPath is permitted to return null value

Dec 9 '02; API spec. version: 1.2; made by: sdedic
ClassPath.getClassPath() documentation omitted the fact, that the method may return null. Although the implementation functioned that way from the beginning, it is considered an incompatible change (tightening of the contract).

Java-related queries

Added extension to the default SourceJavadocAttacherImplementation

Jul 22 '13; API spec. version: 1.47; made by: tzezula; issues: #215971

Added SourceJavadocAttacherImplementation.Definer interface allowing extending the default SourceJavadocAttacherImplementation. Such an extension can download or locate the sources and javadoc for given binary.

The SourceLevelQuery supports JDK 8 profiles

Apr 10 '13; API spec. version: 1.47; made by: tzezula; issues: #228278

The JDK Profile was changed to enum type.


Compatibility: Incompatible change of not released API.

The SourceLevelQuery supports JDK 8 profiles

Mar 5 '13; API spec. version: 1.45; made by: tzezula; issues: #226657

The JDK 8 provides three limited profiles (compact1, compact2, compact3) in addition to the full JDK. Each profile specifies a specific set of Java API packages and contains all of the APIs of the smaller profile. The new API allows a client of the SourceLevelQuery to query the required profile.

The SourceLevelQuery supports source level synonyms

Jun 7 '12; API spec. version: 1.40; made by: tzezula; issues: #202329

The semantics of the SourceLevelQuery, SourceLevelQueryImplementation and SourceLevelQueryImplementation2 was extended to support source level synonyms. The SourceLevelQueryImplementation and SourceLevelQueryImplementation2 can return source level synonyms, e.g. "5" for "1.5". These synonyms are always normalized by the SourceLevelQuery before they are teturned to an API client.

Added SourceJavadocAttacher to allow clients to attach source (javadoc) roots to binary root

Aug 11 '11; API spec. version: 1.35; affected top-level classes: SourceJavadocAttacher SourceJavadocAttacherImplementation; made by: tzezula; issues: #200698

Added an API to allow clients to attach source roots and javadoc roots to binary roots. The API delegates to SPI implementations which provide specific behavior depending on type of binary root (platform, library, maven artifact). There is also fallback implementation handling unknown binary roots by storing the bindings into IDE's userdir.

Added notifications about source level changes into SourceLevelQuery

Jul 8 '10; API spec. version: 1.30; affected top-level classes: SourceLevelQuery SourceLevelQueryImplementation2; made by: tzezula; issues: #185031

The SourceLevelQuery did not allow listening on the source level changes. Such a notifications are required by the annotation processor support and indexing. This API change adds a SourceLevelQuery.getSourceLevel2 which returns a Result object which allows listening like other queries.

Support for delegating SourceForBinaryQueryImplementation2

Mar 13 '08; API spec. version: 1.16; made by: tzezula; issues: #129884

Added support base class for SourceForBinaryQueryImplementation2 which delegates to other SourceForBinaryQueryImplementations.

Support for passing hint to the java infrastructure whether it should prefer source or binary

Mar 10 '08; API spec. version: 1.15; made by: tzezula; issues: #128695

It is possible for the SouceForBinaryQuery provider to specify whether the java module should prefer sources or binaries. In general sources should be preferred for projects where user can make modification. The binaries should be preferred for libraries and platforms where sources may not be complete or correct.

BinaryForSourceQuery returns folder(s) containing binaries for source rooot

Feb 8 '07; API spec. version: 1.12; made by: tzezula

The new API BinaryForSourceQuery was added to allow clients to find out the output (class files) corresponding to source root. The query uses instances of a SPI interface BinaryForSourceQueryImplementation registered in the system lookup to find out the binaries. When no binary is found it uses the default algorithm (SFBQ.findSources(ClassPath.EXECUTE) == sourceRoot)

UnitTestForSourceQuery supports multiple source and test roots

Nov 8 '04; API spec. version: 1.7; made by: tzezula

Added two static methods, findSources(FileObject) and findUnitTests(FileObject), into UnitTestForSourceQuery. Added a new SPI interface MultipleRootsUnitTestForSourceQueryImplementation which allows to a project type to return more than one source/test root. The change was required to allow support of multiple source and test roots.


Compatibility: Compatibility with the old API and SPI is provided. Both versions of SPI interfaces are used by the API; a project type may still implement the deprecated UnitTestForSourceQueryImplementation rather than MultipleRootsUnitTestForSourceQueryImplementation.

Added SourceLevelQuery

Apr 27 '04; API spec. version: 1.5; made by: dkonecny

Added query answering the source level of a Java file.

Added several queries

Mar 16 '04; API spec. version: 1.4; made by: jglick

Several new queries were added (API and SPI) to represent various aspects of Java sources.


Built on October 11 2013.  |  Portions Copyright 1997-2013 Oracle. All rights reserved.