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.

View | Details | Raw Unified | Return to bug 179799
Collapse All | Expand All

(-)a/api.java.classpath/apichanges.xml (+15 lines)
Lines 73-78 Link Here
73
<!-- ACTUAL CHANGES BEGIN HERE: -->
73
<!-- ACTUAL CHANGES BEGIN HERE: -->
74
74
75
<changes>
75
<changes>
76
        <change id="ClassPath.EMPTY">
77
            <api name="classpath"/>
78
            <summary>Added a constant representing an empty ClassPath</summary>
79
            <version major="1" minor="24"/>
80
            <date day="25" month="1" year="2010"/>
81
            <author login="tzezula"/>
82
            <compatibility addition="yes" modification="no" semantic="compatible" source="compatible" binary="compatible"/>
83
            <description>
84
                <p>
85
                    Added a constant representing an empty ClassPath like java.util.Collections.EMPTY_LIST.
86
                    This ClassPath has no entries and never fires any events.
87
                </p>
88
            </description>
89
            <issue number="179799"/>
90
        </change>
76
        <change id="classpath-api-module">
91
        <change id="classpath-api-module">
77
            <api name="classpath"/>
92
            <api name="classpath"/>
78
            <summary>Splitting the java API to independent ClassPath API and the rest of the java API</summary>
93
            <summary>Splitting the java API to independent ClassPath API and the rest of the java API</summary>
(-)a/api.java.classpath/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.api.java.classpath/1
2
OpenIDE-Module: org.netbeans.api.java.classpath/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/classpath/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/classpath/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.23
4
OpenIDE-Module-Specification-Version: 1.24
5
5
(-)a/api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java (-1 / +9 lines)
Lines 69-74 Link Here
69
import org.netbeans.spi.java.classpath.ClassPathProvider;
69
import org.netbeans.spi.java.classpath.ClassPathProvider;
70
import org.netbeans.spi.java.classpath.FilteringPathResourceImplementation;
70
import org.netbeans.spi.java.classpath.FilteringPathResourceImplementation;
71
import org.netbeans.spi.java.classpath.PathResourceImplementation;
71
import org.netbeans.spi.java.classpath.PathResourceImplementation;
72
import org.netbeans.spi.java.classpath.support.ClassPathSupport;
72
import org.openide.filesystems.FileAttributeEvent;
73
import org.openide.filesystems.FileAttributeEvent;
73
import org.openide.filesystems.FileChangeListener;
74
import org.openide.filesystems.FileChangeListener;
74
import org.openide.filesystems.FileEvent;
75
import org.openide.filesystems.FileEvent;
Lines 204-210 Link Here
204
     * @since org.netbeans.api.java/1 1.13
205
     * @since org.netbeans.api.java/1 1.13
205
     */
206
     */
206
    public static final String PROP_INCLUDES = "includes";
207
    public static final String PROP_INCLUDES = "includes";
207
    
208
209
    /**
210
     * The empty ClassPath.
211
     * Contains no entries and never fires events.
212
     * @since 1.24
213
     */
214
    public static final ClassPath EMPTY = ClassPathSupport.createClassPath(new URL[0]);
215
208
    private static final Logger LOG = Logger.getLogger(ClassPath.class.getName());
216
    private static final Logger LOG = Logger.getLogger(ClassPath.class.getName());
209
    
217
    
210
    private static final Lookup.Result<? extends ClassPathProvider> implementations =
218
    private static final Lookup.Result<? extends ClassPathProvider> implementations =
(-)a/api.java.classpath/test/unit/src/org/netbeans/api/java/classpath/ClassPathTest.java (+11 lines)
Lines 706-711 Link Here
706
        assertEquals(cp.toString(), ClassPathSupport.createClassPath(cp.toString()).toString());
706
        assertEquals(cp.toString(), ClassPathSupport.createClassPath(cp.toString()).toString());
707
        // XXX could also test IAE (tricky - need to have a URLMapper in Lookup, etc.)
707
        // XXX could also test IAE (tricky - need to have a URLMapper in Lookup, etc.)
708
    }
708
    }
709
710
    public void testEmptyClassPath() throws Exception {
711
        final ClassPath cp = ClassPath.EMPTY;
712
        assertNotNull(cp);
713
        assertTrue(cp.entries().isEmpty());
714
        assertEquals(System.identityHashCode(cp), System.identityHashCode(ClassPath.EMPTY));
715
        java.lang.reflect.Field f = ClassPath.class.getDeclaredField("EMPTY");
716
        assertNotNull(f);
717
        assertEquals(java.lang.reflect.Modifier.FINAL, f.getModifiers() & java.lang.reflect.Modifier.FINAL);
718
    }
719
709
    private String massagePath(String path) throws Exception {
720
    private String massagePath(String path) throws Exception {
710
        return path.replace('/', File.separatorChar).replace(':', File.pathSeparatorChar).replace("<root>", getWorkDir().getAbsolutePath());
721
        return path.replace('/', File.separatorChar).replace(':', File.pathSeparatorChar).replace("<root>", getWorkDir().getAbsolutePath());
711
    }
722
    }

Return to bug 179799