This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
There are lots of places in the java.source and other module where the API requires non null ClassPath parameter, which forces the caller to create a new empty ClassPath. To create a new empty ClassPath you neede to call ClassPathSupport.createClassPath(new URL[0]). Also each such a client creates a new useless instance of an empty ClassPath. This API change adds a new constant EMPTY into the ClassPath which can be used by these clients. The API change is a compatible addition to final class, the API should be stable in 6.9.
Created attachment 93498 [details] Diff file
[JG01] Checking modifiers on the constant in a unit test is just noise. Accidental API changes would anyway be notified on the list. [JG02] ClassPathSupport.createClassPath(new URL[0]) probably still holds onto listeners. Better to replace with a ClassPathImplementation that ignores addPropertyChangeListener calls.
JG01: Agree, this is not needed. Signature test will catch the final removal. JG02: Will not help. As the API ClassPath.addPropertyChangeListener() does not add the listeners into SPI ClassPathImplementation. It holds them in its PropertyChangeSupport. The ClassPathImplementation, in this case, has a single listener in its listeners list, the Weak(ClassPath.spiListener).
fixed in jet-main: 8093f649bb6a
Integrated into 'main-golden', will be available in build *201002060200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/8093f649bb6a User: Tomas Zezula <tzezula@netbeans.org> Log: #179799:Api review: Added constant ClassPath.EMPTY
Integrated into 'main-golden', will be available in build *201002230200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/b066191f3cb4 User: Jan Lahoda <jlahoda@netbeans.org> Log: #179799: Do not keep listeners for ClassPath.EMPTY.