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.
<!-- ACTUAL CHANGES BEGIN HERE: -->
<changes>
<change id="ClassPath.EMPTY">
<api name="classpath"/>
<summary>Added a constant representing an empty ClassPath</summary>
<version major="1" minor="24"/>
<date day="25" month="1" year="2010"/>
<author login="tzezula"/>
<compatibility addition="yes" modification="no" semantic="compatible" source="compatible" binary="compatible"/>
<description>
<p>
Added a constant representing an empty ClassPath like java.util.Collections.EMPTY_LIST.
This ClassPath has no entries and never fires any events.
</p>
</description>
<issue number="179799"/>
</change>
<change id="classpath-api-module">
<summary>Splitting the java API to independent ClassPath API and the rest of the java API</summary>
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.api.java.classpath/1
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/classpath/Bundle.properties
OpenIDE-Module-Specification-Version: 1.23
OpenIDE-Module-Specification-Version: 1.24
import org.netbeans.spi.java.classpath.ClassPathProvider;
import org.netbeans.spi.java.classpath.FilteringPathResourceImplementation;
import org.netbeans.spi.java.classpath.PathResourceImplementation;
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
import org.openide.filesystems.FileAttributeEvent;
import org.openide.filesystems.FileChangeListener;
import org.openide.filesystems.FileEvent;
* @since org.netbeans.api.java/1 1.13
*/
public static final String PROP_INCLUDES = "includes";
/**
* The empty ClassPath.
* Contains no entries and never fires events.
* @since 1.24
public static final ClassPath EMPTY = ClassPathSupport.createClassPath(new URL[0]);
private static final Logger LOG = Logger.getLogger(ClassPath.class.getName());
private static final Lookup.Result<? extends ClassPathProvider> implementations =
assertEquals(cp.toString(), ClassPathSupport.createClassPath(cp.toString()).toString());
// XXX could also test IAE (tricky - need to have a URLMapper in Lookup, etc.)
}
public void testEmptyClassPath() throws Exception {
final ClassPath cp = ClassPath.EMPTY;
assertNotNull(cp);
assertTrue(cp.entries().isEmpty());
assertEquals(System.identityHashCode(cp), System.identityHashCode(ClassPath.EMPTY));
java.lang.reflect.Field f = ClassPath.class.getDeclaredField("EMPTY");
assertNotNull(f);
assertEquals(java.lang.reflect.Modifier.FINAL, f.getModifiers() & java.lang.reflect.Modifier.FINAL);
private String massagePath(String path) throws Exception {
return path.replace('/', File.separatorChar).replace(':', File.pathSeparatorChar).replace("<root>", getWorkDir().getAbsolutePath());