Skip navigation links

Introduction

This document lists changes made to the ClassPath 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.classpath/1 > 1.20

Changes by affected class

org.netbeans.api.java.queries.BinaryForSourceQuery

org.netbeans.spi.java.queries.BinaryForSourceQueryImplementation

org.netbeans.spi.java.queries.BinaryForSourceQueryImplementation2

org.netbeans.api.java.classpath.ClassPath

org.netbeans.spi.java.classpath.ClassPathFactory

org.netbeans.spi.java.classpath.ClassPathImplementation

org.netbeans.spi.java.classpath.ClassPathProvider

org.netbeans.spi.java.classpath.support.ClassPathSupport

org.netbeans.spi.java.classpath.support.CompositePathResourceBase

org.netbeans.spi.java.classpath.FilteringPathResourceImplementation

org.netbeans.spi.java.classpath.FlaggedClassPathImplementation

org.netbeans.api.java.classpath.GlobalPathRegistry

org.netbeans.spi.java.classpath.GlobalPathRegistryImplementation

org.netbeans.spi.java.classpath.support.PathResourceBase

org.netbeans.spi.java.classpath.PathResourceImplementation

org.netbeans.api.java.queries.SourceForBinaryQuery

org.netbeans.spi.java.queries.support.SourceForBinaryQueryImpl2Base

org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation2


Details of all changes by API and date


Classpath API

Prefer binaries over sources when parsing

Feb 14 '19; API spec. version: 1.58; affected top-level classes: BinaryForSourceQuery BinaryForSourceQueryImplementation2; made by: jtulach

New Result2 and new BinaryForSourceQueryImplementation2 that allows one to specify that binaries should be used instead of compiling the sources (if the binaries are already compiled and newer).

Added a ClassPath switching among several ClassPath instances

Oct 4 '16; API spec. version: 1.54; affected top-level classes: ClassPathSupport; made by: tzezula

Added a factory method into ClassPathSupport creating a ClassPath switching among several ClassPath instances.

Added a policy for handling in archive paths

Jun 2 '15; API spec. version: 1.52; affected top-level classes: ClassPath; made by: tzezula

Added a policy for handling in archive paths while converting the ClassPath to String. The ClassPath.toString takes a PathEmbeddingMode parameter determining how the in archive path is handled. It can be included into stringified root, omitted from it, or handled as an invalid classpath root.

Added a SPI interface to allow different implementations of GlobalPathRegistry

Oct 31 '14; API spec. version: 1.48; affected top-level classes: GlobalPathRegistryImplementation; made by: tzezula

Added a SPI interface to allow different implementations of the GlobalPathRegistry. The GlobalPathRegistry uses the first instance od the GlobalPathRegistryImplementation registered in the global Lookup

Added ClassPath flags

Aug 21 '14; API spec. version: 1.44; affected top-level classes: ClassPath FlaggedClassPathImplementation; made by: tzezula; issues: #245155

Added flags to ClassPath

Added a constant representing an empty ClassPath

Feb 5 '10; API spec. version: 1.24; made by: tzezula; issues: #179799

Added a constant representing an empty ClassPath like java.util.Collections.EMPTY_LIST. This ClassPath has no entries and never fires any events.

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; affected top-level classes: ClassPath ClassPathSupport; 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; affected top-level classes: ClassPath FilteringPathResourceImplementation; 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; affected top-level classes: ClassPath ClassPathProvider ClassPathFactory ClassPathImplementation PathResourceImplementation ClassPathSupport CompositePathResourceBase PathResourceBase; 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; affected top-level classes: GlobalPathRegistry; 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).

Source for binary and binary for source queries

Support for delegating SourceForBinaryQueryImplementation2

Mar 13 '08; API spec. version: 1.16; affected top-level classes: SourceForBinaryQueryImpl2Base; 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; affected top-level classes: SourceForBinaryQuery SourceForBinaryQueryImplementation2; 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; affected top-level classes: BinaryForSourceQuery BinaryForSourceQueryImplementation; 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)