View | Details | Raw Unified | Return to bug 207294 | Differences between
and this patch

Collapse All | Expand All

(-)a/ant.debugger/nbproject/project.xml (-1 / +1 lines)
 Lines 121-127    Link Here 
121
                    <build-prerequisite/>
121
                    <build-prerequisite/>
122
                    <compile-dependency/>
122
                    <compile-dependency/>
123
                    <run-dependency>
123
                    <run-dependency>
124
                        <specification-version>6.2</specification-version>
124
                        <specification-version>7.57</specification-version>
125
                    </run-dependency>
125
                    </run-dependency>
126
                </dependency>
126
                </dependency>
127
                <dependency>
127
                <dependency>
(-)a/ant.debugger/src/org/netbeans/modules/ant/debugger/Utils.java (-6 / +1 lines)
 Lines 65-71    Link Here 
65
import org.openide.cookies.EditorCookie;
65
import org.openide.cookies.EditorCookie;
66
import org.openide.cookies.LineCookie;
66
import org.openide.cookies.LineCookie;
67
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileObject;
68
import org.openide.filesystems.FileStateInvalidException;
69
import org.openide.filesystems.FileUtil;
68
import org.openide.filesystems.FileUtil;
70
import org.openide.loaders.DataObject;
69
import org.openide.loaders.DataObject;
71
import org.openide.loaders.DataObjectNotFoundException;
70
import org.openide.loaders.DataObjectNotFoundException;
 Lines 405-415    Link Here 
405
        }
404
        }
406
        InputSource in = new InputSource (new StringReader (w.toString ()));
405
        InputSource in = new InputSource (new StringReader (w.toString ()));
407
        if (fo != null) { // #10348
406
        if (fo != null) { // #10348
408
            try {
407
                in.setSystemId(fo.toURL().toExternalForm());
409
                in.setSystemId (fo.getURL ().toExternalForm ());
410
            } catch (FileStateInvalidException e) {
411
                assert false : e;
412
            }
413
            // [PENDING] Ant's ProjectHelper has an elaborate set of work-
408
            // [PENDING] Ant's ProjectHelper has an elaborate set of work-
414
            // arounds for inconsistent parser behavior, e.g. file:foo.xml
409
            // arounds for inconsistent parser behavior, e.g. file:foo.xml
415
            // works in Ant but not with Xerces parser. You must use just foo.xml
410
            // works in Ant but not with Xerces parser. You must use just foo.xml
(-)a/ant.debugger/src/org/netbeans/modules/ant/debugger/breakpoints/BreakpointsReader.java (-7 / +1 lines)
 Lines 49-59    Link Here 
49
import java.net.MalformedURLException;
49
import java.net.MalformedURLException;
50
import java.net.URL;
50
import java.net.URL;
51
import org.netbeans.api.debugger.Breakpoint;
51
import org.netbeans.api.debugger.Breakpoint;
52
import org.netbeans.api.debugger.DebuggerManager;
53
import org.netbeans.api.debugger.Properties;
52
import org.netbeans.api.debugger.Properties;
54
import org.openide.cookies.LineCookie;
53
import org.openide.cookies.LineCookie;
55
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileObject;
56
import org.openide.filesystems.FileStateInvalidException;
57
import org.openide.filesystems.URLMapper;
55
import org.openide.filesystems.URLMapper;
58
import org.openide.loaders.DataObject;
56
import org.openide.loaders.DataObject;
59
import org.openide.loaders.DataObjectNotFoundException;
57
import org.openide.loaders.DataObjectNotFoundException;
 Lines 105-112    Link Here 
105
        AntBreakpoint b = (AntBreakpoint) object;
103
        AntBreakpoint b = (AntBreakpoint) object;
106
        FileObject fo = (FileObject) b.getLine ().getLookup ().
104
        FileObject fo = (FileObject) b.getLine ().getLookup ().
107
            lookup (FileObject.class);
105
            lookup (FileObject.class);
108
        try {
106
            properties.setString("url", fo.toURL().toString());
109
            properties.setString ("url", fo.getURL ().toString ());
110
            properties.setInt (
107
            properties.setInt (
111
                "lineNumber", 
108
                "lineNumber", 
112
                b.getLine ().getLineNumber ()
109
                b.getLine ().getLineNumber ()
 Lines 119-127    Link Here 
119
            properties.setInt(Breakpoint.PROP_HIT_COUNT_FILTER, b.getHitCountFilter());
116
            properties.setInt(Breakpoint.PROP_HIT_COUNT_FILTER, b.getHitCountFilter());
120
            Breakpoint.HIT_COUNT_FILTERING_STYLE style = b.getHitCountFilteringStyle();
117
            Breakpoint.HIT_COUNT_FILTERING_STYLE style = b.getHitCountFilteringStyle();
121
            properties.setInt(Breakpoint.PROP_HIT_COUNT_FILTER+"_style", style != null ? style.ordinal() : 0); // NOI18N
118
            properties.setInt(Breakpoint.PROP_HIT_COUNT_FILTER+"_style", style != null ? style.ordinal() : 0); // NOI18N
122
        } catch (FileStateInvalidException ex) {
123
            ex.printStackTrace ();
124
        }
125
    }
119
    }
126
    
120
    
127
121
(-)a/api.debugger.jpda/nbproject/project.xml (-1 / +1 lines)
 Lines 106-112    Link Here 
106
                    <build-prerequisite/>
106
                    <build-prerequisite/>
107
                    <compile-dependency/>
107
                    <compile-dependency/>
108
                    <run-dependency>
108
                    <run-dependency>
109
                        <specification-version>7.0</specification-version>
109
                        <specification-version>7.57</specification-version>
110
                    </run-dependency>
110
                    </run-dependency>
111
                </dependency>
111
                </dependency>
112
                <dependency>
112
                <dependency>
(-)a/api.debugger.jpda/src/org/netbeans/api/debugger/jpda/LineBreakpoint.java (-13 / +2 lines)
 Lines 49-57    Link Here 
49
import java.io.IOException;
49
import java.io.IOException;
50
import java.net.MalformedURLException;
50
import java.net.MalformedURLException;
51
import java.net.URL;
51
import java.net.URL;
52
import java.util.ArrayList;
53
import java.util.Collection;
52
import java.util.Collection;
54
import java.util.List;
55
import java.util.Map;
53
import java.util.Map;
56
import java.util.WeakHashMap;
54
import java.util.WeakHashMap;
57
import javax.swing.event.ChangeEvent;
55
import javax.swing.event.ChangeEvent;
 Lines 67-73    Link Here 
67
import org.openide.filesystems.FileEvent;
65
import org.openide.filesystems.FileEvent;
68
import org.openide.filesystems.FileObject;
66
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileRenameEvent;
67
import org.openide.filesystems.FileRenameEvent;
70
import org.openide.filesystems.FileStateInvalidException;
71
import org.openide.filesystems.URLMapper;
68
import org.openide.filesystems.URLMapper;
72
import org.openide.loaders.DataObject;
69
import org.openide.loaders.DataObject;
73
import org.openide.util.NbBundle;
70
import org.openide.util.NbBundle;
 Lines 518-528    Link Here 
518
        }
515
        }
519
516
520
        public void fileRenamed(FileRenameEvent fe) {
517
        public void fileRenamed(FileRenameEvent fe) {
521
            try {
518
                this.setURL(((FileObject) fe.getSource()).toURL().toString());
522
                this.setURL(((FileObject) fe.getSource()).getURL().toString());
523
            } catch (FileStateInvalidException ex) {
524
                ErrorManager.getDefault().notify(ex);
525
            }
526
        }
519
        }
527
520
528
        public void fileAttributeChanged(FileAttributeEvent fe) {
521
        public void fileAttributeChanged(FileAttributeEvent fe) {
 Lines 562-572    Link Here 
562
                FileObject newFO = ((DataObject) evt.getSource()).getPrimaryFile();
555
                FileObject newFO = ((DataObject) evt.getSource()).getPrimaryFile();
563
                fileListener = WeakListeners.create(FileChangeListener.class, this, newFO);
556
                fileListener = WeakListeners.create(FileChangeListener.class, this, newFO);
564
                newFO.addFileChangeListener(fileListener);
557
                newFO.addFileChangeListener(fileListener);
565
                try {
558
                    this.setURL(newFO.toURL().toString());
566
                    this.setURL(newFO.getURL().toString());
567
                } catch (FileStateInvalidException ex) {
568
                    ErrorManager.getDefault().notify(ex);
569
                }
570
                fo = newFO;
559
                fo = newFO;
571
                DebuggerManager.getDebuggerManager().addBreakpoint(this);
560
                DebuggerManager.getDebuggerManager().addBreakpoint(this);
572
                firePropertyChange(PROP_GROUP_PROPERTIES, null, null);
561
                firePropertyChange(PROP_GROUP_PROPERTIES, null, null);
(-)a/api.java.classpath/nbproject/project.xml (-2 / +2 lines)
 Lines 19-25    Link Here 
19
                    <build-prerequisite/>
19
                    <build-prerequisite/>
20
                    <compile-dependency/>
20
                    <compile-dependency/>
21
                    <run-dependency>
21
                    <run-dependency>
22
                        <specification-version>1.12</specification-version>
22
                        <specification-version>1.26</specification-version>
23
                    </run-dependency>
23
                    </run-dependency>
24
                </dependency>
24
                </dependency>
25
                <dependency>
25
                <dependency>
 Lines 27-33    Link Here 
27
                    <build-prerequisite/>
27
                    <build-prerequisite/>
28
                    <compile-dependency/>
28
                    <compile-dependency/>
29
                    <run-dependency>
29
                    <run-dependency>
30
                        <specification-version>7.9</specification-version>
30
                        <specification-version>7.57</specification-version>
31
                    </run-dependency>
31
                    </run-dependency>
32
                </dependency>
32
                </dependency>
33
                <dependency>
33
                <dependency>
(-)a/api.java.classpath/src/org/netbeans/api/java/classpath/ClassLoaderSupport.java (-7 / +2 lines)
 Lines 68-79    Link Here 
68
    }
68
    }
69
    
69
    
70
    static ClassLoader create (final ClassPath cp, final ClassLoader parentClassLoader) {
70
    static ClassLoader create (final ClassPath cp, final ClassLoader parentClassLoader) {
71
        try {
71
        return new ClassLoaderSupport(cp, parentClassLoader);
72
            return new ClassLoaderSupport(cp, parentClassLoader);
73
        } catch (FileStateInvalidException e) {
74
            // Should not happen, we already trimmed unused roots:
75
            throw new AssertionError(e);
76
        }
77
    }
72
    }
78
73
79
    /** change listener */
74
    /** change listener */
 Lines 97-103    Link Here 
97
    /** Constructor that attaches itself to the filesystem pool.
92
    /** Constructor that attaches itself to the filesystem pool.
98
    */
93
    */
99
    @SuppressWarnings("LeakingThisInConstructor")
94
    @SuppressWarnings("LeakingThisInConstructor")
100
    private ClassLoaderSupport (final ClassPath cp, final ClassLoader parentClassLoader) throws FileStateInvalidException {
95
    private ClassLoaderSupport (final ClassPath cp, final ClassLoader parentClassLoader) {
101
        super(cp.getRoots(), parentClassLoader, null);
96
        super(cp.getRoots(), parentClassLoader, null);
102
        this.classPath = cp;
97
        this.classPath = cp;
103
98
(-)a/api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java (-11 / +2 lines)
 Lines 83-89    Link Here 
83
import org.openide.filesystems.FileEvent;
83
import org.openide.filesystems.FileEvent;
84
import org.openide.filesystems.FileObject;
84
import org.openide.filesystems.FileObject;
85
import org.openide.filesystems.FileRenameEvent;
85
import org.openide.filesystems.FileRenameEvent;
86
import org.openide.filesystems.FileStateInvalidException;
87
import org.openide.filesystems.FileUtil;
86
import org.openide.filesystems.FileUtil;
88
import org.openide.filesystems.URLMapper;
87
import org.openide.filesystems.URLMapper;
89
import org.openide.util.Lookup;
88
import org.openide.util.Lookup;
 Lines 559-569    Link Here 
559
        if (f.isFolder()) {
558
        if (f.isFolder()) {
560
            path += "/"; // NOI18N
559
            path += "/"; // NOI18N
561
        }
560
        }
562
        try {
561
        return filter.includes(root.toURL(), path);
563
            return filter.includes(root.getURL(), path);
564
        } catch (FileStateInvalidException x) {
565
            throw new AssertionError(x);
566
        }
567
    }
562
    }
568
563
569
    /**
564
    /**
 Lines 1047-1053    Link Here 
1047
            f = findPath(roots[ridx], nameComponents);
1042
            f = findPath(roots[ridx], nameComponents);
1048
            FilteringPathResourceImplementation filter = root2Filter.get(roots[ridx]);
1043
            FilteringPathResourceImplementation filter = root2Filter.get(roots[ridx]);
1049
            if (filter != null) {
1044
            if (filter != null) {
1050
                try {
1051
                    if (f != null) {
1045
                    if (f != null) {
1052
                        String path = FileUtil.getRelativePath(roots[ridx], f);
1046
                        String path = FileUtil.getRelativePath(roots[ridx], f);
1053
                        assert path != null : String.format("FileUtil.getRelativePath(%s(%b),%s(%b)) returned null",
1047
                        assert path != null : String.format("FileUtil.getRelativePath(%s(%b),%s(%b)) returned null",
 Lines 1058-1070    Link Here 
1058
                        if (f.isFolder()) {
1052
                        if (f.isFolder()) {
1059
                            path += "/"; // NOI18N
1053
                            path += "/"; // NOI18N
1060
                        }
1054
                        }
1061
                        if (!filter.includes(roots[ridx].getURL(), path)) {
1055
                        if (!filter.includes(roots[ridx].toURL(), path)) {
1062
                            f = null;
1056
                            f = null;
1063
                        }
1057
                        }
1064
                    }
1058
                    }
1065
                } catch (FileStateInvalidException x) {
1066
                    throw new AssertionError(x);
1067
                }
1068
            }
1059
            }
1069
        }
1060
        }
1070
        rootIndex[0] = ridx;
1061
        rootIndex[0] = ridx;
(-)a/api.java.classpath/src/org/netbeans/api/java/queries/BinaryForSourceQuery.java (-7 / +1 lines)
 Lines 50-59    Link Here 
50
import org.netbeans.api.java.classpath.ClassPath;
50
import org.netbeans.api.java.classpath.ClassPath;
51
import org.netbeans.spi.java.queries.BinaryForSourceQueryImplementation;
51
import org.netbeans.spi.java.queries.BinaryForSourceQueryImplementation;
52
import org.openide.filesystems.FileObject;
52
import org.openide.filesystems.FileObject;
53
import org.openide.filesystems.FileStateInvalidException;
54
import org.openide.filesystems.FileUtil;
53
import org.openide.filesystems.FileUtil;
55
import org.openide.filesystems.URLMapper;
54
import org.openide.filesystems.URLMapper;
56
import org.openide.util.Exceptions;
57
import org.openide.util.Lookup;
55
import org.openide.util.Lookup;
58
56
59
/**
57
/**
 Lines 138-150    Link Here 
138
            for (ClassPath.Entry e : exec.entries()) {
136
            for (ClassPath.Entry e : exec.entries()) {
139
                FileObject[] roots = SourceForBinaryQuery.findSourceRoots(e.getURL()).getRoots();
137
                FileObject[] roots = SourceForBinaryQuery.findSourceRoots(e.getURL()).getRoots();
140
                for (FileObject root : roots) {
138
                for (FileObject root : roots) {
141
                    try {
139
                        if (sourceRoot.equals (root.toURL())) {
142
                        if (sourceRoot.equals (root.getURL())) {
143
                            result.add (e.getURL());
140
                            result.add (e.getURL());
144
                        }
141
                        }
145
                    } catch (FileStateInvalidException fsie) {
146
                        Exceptions.printStackTrace(fsie);
147
                    }
148
                }
142
                }
149
            }
143
            }
150
            return result.toArray(new URL[result.size()]);
144
            return result.toArray(new URL[result.size()]);
(-)a/api.java.classpath/src/org/netbeans/spi/java/classpath/support/ClassPathSupport.java (-7 / +1 lines)
 Lines 54-62    Link Here 
54
import java.net.URL;
54
import java.net.URL;
55
import java.util.List;
55
import java.util.List;
56
import java.util.ArrayList;
56
import java.util.ArrayList;
57
import org.openide.filesystems.FileStateInvalidException;
58
import org.openide.filesystems.FileUtil;
57
import org.openide.filesystems.FileUtil;
59
import org.openide.util.Exceptions;
60
58
61
/**
59
/**
62
 * Convenience factory for creating classpaths of common sorts.
60
 * Convenience factory for creating classpaths of common sorts.
 Lines 124-135    Link Here 
124
            if (root == null || !root.isValid()) {
122
            if (root == null || !root.isValid()) {
125
                continue;
123
                continue;
126
            }
124
            }
127
            try {
125
                URL u = root.toURL();
128
                URL u = root.getURL();            
129
                l.add(createResource(u));
126
                l.add(createResource(u));
130
            } catch (FileStateInvalidException e) {
131
                Exceptions.printStackTrace (e);
132
            }
133
        }
127
        }
134
        return createClassPath (l);
128
        return createClassPath (l);
135
    }
129
    }
(-)a/api.java.classpath/test/unit/src/org/netbeans/api/java/classpath/ClassPathTest.java (-16 / +16 lines)
 Lines 245-251    Link Here 
245
        assertTrue (cp.getRoots().length==1);
245
        assertTrue (cp.getRoots().length==1);
246
        impl.assertEvents(ClassPath.PROP_ROOTS);
246
        impl.assertEvents(ClassPath.PROP_ROOTS);
247
        FileObject archiveFile = FileUtil.toFileObject(root_3);
247
        FileObject archiveFile = FileUtil.toFileObject(root_3);
248
        impl.addResource(FileUtil.getArchiveRoot(archiveFile.getURL()));
248
        impl.addResource(FileUtil.getArchiveRoot(archiveFile.toURL()));
249
        assertEquals (cp.getRoots().length,2);
249
        assertEquals (cp.getRoots().length,2);
250
        impl.assertEvents(ClassPath.PROP_ENTRIES, ClassPath.PROP_ROOTS);
250
        impl.assertEvents(ClassPath.PROP_ENTRIES, ClassPath.PROP_ROOTS);
251
        root_3.delete();
251
        root_3.delete();
 Lines 365-372    Link Here 
365
        FileObject bd = FileUtil.toFileObject(getBaseDir());
365
        FileObject bd = FileUtil.toFileObject(getBaseDir());
366
        FileObject u1fo = bd.createFolder("u1");
366
        FileObject u1fo = bd.createFolder("u1");
367
        FileObject u2fo = bd.createFolder("u2");
367
        FileObject u2fo = bd.createFolder("u2");
368
        final URL u1 = u1fo.getURL();
368
        final URL u1 = u1fo.toURL();
369
        final URL u2 = u2fo.getURL();
369
        final URL u2 = u2fo.toURL();
370
        class FPRI implements FilteringPathResourceImplementation {
370
        class FPRI implements FilteringPathResourceImplementation {
371
            private int modulus = 2;
371
            private int modulus = 2;
372
            public void changeIncludes(int modulus) {
372
            public void changeIncludes(int modulus) {
 Lines 482-496    Link Here 
482
            e1.includes(xx2);
482
            e1.includes(xx2);
483
            fail();
483
            fail();
484
        } catch (IllegalArgumentException iae) {}
484
        } catch (IllegalArgumentException iae) {}
485
        assertTrue(e1.includes(xx1.getURL()));
485
        assertTrue(e1.includes(xx1.toURL()));
486
        assertTrue(e1.includes(x_1.getURL()));
486
        assertTrue(e1.includes(x_1.toURL()));
487
        assertFalse(e1.includes(xxx1.getURL()));
487
        assertFalse(e1.includes(xxx1.toURL()));
488
        assertFalse(e1.includes(cau1.getURL()));
488
        assertFalse(e1.includes(cau1.toURL()));
489
        assertFalse(e1.includes(xy1.getURL()));
489
        assertFalse(e1.includes(xy1.toURL()));
490
        assertFalse(e1.includes(folder.getURL()));
490
        assertFalse(e1.includes(folder.toURL()));
491
        assertTrue(e1.includes(foldr.getURL()));
491
        assertTrue(e1.includes(foldr.toURL()));
492
        try {
492
        try {
493
            e1.includes(xx2.getURL());
493
            e1.includes(xx2.toURL());
494
            fail();
494
            fail();
495
        } catch (IllegalArgumentException iae) {}
495
        } catch (IllegalArgumentException iae) {}
496
        cp.addPropertyChangeListener(impl);
496
        cp.addPropertyChangeListener(impl);
 Lines 522-532    Link Here 
522
        assertTrue(e1.includes(xxx1));
522
        assertTrue(e1.includes(xxx1));
523
        assertTrue(e1.includes(cau1));
523
        assertTrue(e1.includes(cau1));
524
        assertTrue(e1.includes(xy1));
524
        assertTrue(e1.includes(xy1));
525
        assertFalse(e1.includes(xx1.getURL()));
525
        assertFalse(e1.includes(xx1.toURL()));
526
        assertFalse(e1.includes(x_1.getURL()));
526
        assertFalse(e1.includes(x_1.toURL()));
527
        assertTrue(e1.includes(xxx1.getURL()));
527
        assertTrue(e1.includes(xxx1.toURL()));
528
        assertTrue(e1.includes(cau1.getURL()));
528
        assertTrue(e1.includes(cau1.toURL()));
529
        assertTrue(e1.includes(xy1.getURL()));
529
        assertTrue(e1.includes(xy1.toURL()));
530
    }
530
    }
531
531
532
    public void testFpriChangeFiring() throws Exception {
532
    public void testFpriChangeFiring() throws Exception {
(-)a/api.java.classpath/test/unit/src/org/netbeans/api/java/classpath/GlobalPathRegistryTest.java (-8 / +4 lines)
 Lines 159-165    Link Here 
159
    public void testGetSourceRoots () throws Exception {
159
    public void testGetSourceRoots () throws Exception {
160
        SFBQImpl query = Lookup.getDefault().lookup(SFBQImpl.class);
160
        SFBQImpl query = Lookup.getDefault().lookup(SFBQImpl.class);
161
        assertNotNull ("SourceForBinaryQueryImplementation not found in lookup",query);                
161
        assertNotNull ("SourceForBinaryQueryImplementation not found in lookup",query);                
162
        query.addPair(cp3.getRoots()[0].getURL(),new FileObject[0]);
162
        query.addPair(cp3.getRoots()[0].toURL(),new FileObject[0]);
163
        ClassPathTest.TestClassPathImplementation cpChangingImpl = new ClassPathTest.TestClassPathImplementation();
163
        ClassPathTest.TestClassPathImplementation cpChangingImpl = new ClassPathTest.TestClassPathImplementation();
164
        ClassPath cpChanging = ClassPathFactory.createClassPath(cpChangingImpl);
164
        ClassPath cpChanging = ClassPathFactory.createClassPath(cpChangingImpl);
165
        assertEquals("cpChangingImpl is empty", 0, cpChanging.getRoots().length);
165
        assertEquals("cpChangingImpl is empty", 0, cpChanging.getRoots().length);
 Lines 179-185    Link Here 
179
        assertTrue ("Missing roots from cp2",result.containsAll (Arrays.asList(cp2.getRoots())));                
179
        assertTrue ("Missing roots from cp2",result.containsAll (Arrays.asList(cp2.getRoots())));                
180
        cpChangingImpl.removeResource(u);
180
        cpChangingImpl.removeResource(u);
181
        
181
        
182
        query.addPair(cp3.getRoots()[0].getURL(),cp4.getRoots());       
182
        query.addPair(cp3.getRoots()[0].toURL(),cp4.getRoots());
183
        result = r.getSourceRoots();
183
        result = r.getSourceRoots();
184
        assertEquals ("Wrong number of source roots",result.size(),cp1.getRoots().length + cp2.getRoots().length+cp4.getRoots().length);
184
        assertEquals ("Wrong number of source roots",result.size(),cp1.getRoots().length + cp2.getRoots().length+cp4.getRoots().length);
185
        assertTrue ("Missing roots from cp1",result.containsAll (Arrays.asList(cp1.getRoots())));
185
        assertTrue ("Missing roots from cp1",result.containsAll (Arrays.asList(cp1.getRoots())));
 Lines 222-232    Link Here 
222
        FileObject src2excluded1 = FileUtil.createData(src2, "excluded/file1");
222
        FileObject src2excluded1 = FileUtil.createData(src2, "excluded/file1");
223
        class PRI extends PathResourceBase implements FilteringPathResourceImplementation {
223
        class PRI extends PathResourceBase implements FilteringPathResourceImplementation {
224
            public URL[] getRoots() {
224
            public URL[] getRoots() {
225
                try {
225
                    return new URL[] {src1.toURL()};
226
                    return new URL[] {src1.getURL()};
227
                } catch (FileStateInvalidException x) {
228
                    throw new AssertionError(x);
229
                }
230
            }
226
            }
231
            public boolean includes(URL root, String resource) {
227
            public boolean includes(URL root, String resource) {
232
                return resource.startsWith("incl");
228
                return resource.startsWith("incl");
 Lines 256-262    Link Here 
256
        assertEquals(Collections.<FileObject>emptySet(), reg.getSourceRoots());
252
        assertEquals(Collections.<FileObject>emptySet(), reg.getSourceRoots());
257
        r.register(ClassPath.COMPILE, new ClassPath[] {cp3});
253
        r.register(ClassPath.COMPILE, new ClassPath[] {cp3});
258
        SFBQImpl query = Lookup.getDefault().lookup(SFBQImpl.class);
254
        SFBQImpl query = Lookup.getDefault().lookup(SFBQImpl.class);
259
        query.addPair(cp3.getRoots()[0].getURL(),cp4.getRoots());       
255
        query.addPair(cp3.getRoots()[0].toURL(),cp4.getRoots());
260
        //There should be one translated source root
256
        //There should be one translated source root
261
        assertEquals(1, reg.getSourceRoots().size());
257
        assertEquals(1, reg.getSourceRoots().size());
262
        assertEquals(1, reg.getResults().size());
258
        assertEquals(1, reg.getResults().size());
(-)a/api.java.classpath/test/unit/src/org/netbeans/api/java/queries/BinaryForSourceQueryTest.java (-4 / +4 lines)
 Lines 90-106    Link Here 
90
        assertNotNull(binaryRoot2);       
90
        assertNotNull(binaryRoot2);       
91
        SFBQImpl.clear();
91
        SFBQImpl.clear();
92
        CPProvider.clear();
92
        CPProvider.clear();
93
        SFBQImpl.register(srcRoot2.getURL(), binaryRoot2.getURL());
93
        SFBQImpl.register(srcRoot2.toURL(), binaryRoot2.toURL());
94
        CPProvider.register(srcRoot2, ClassPath.SOURCE, ClassPathSupport.createClassPath(new FileObject[] {srcRoot2}));
94
        CPProvider.register(srcRoot2, ClassPath.SOURCE, ClassPathSupport.createClassPath(new FileObject[] {srcRoot2}));
95
        CPProvider.register(srcRoot2, ClassPath.EXECUTE, ClassPathSupport.createClassPath(new FileObject[] {binaryRoot2}));        
95
        CPProvider.register(srcRoot2, ClassPath.EXECUTE, ClassPathSupport.createClassPath(new FileObject[] {binaryRoot2}));        
96
    }
96
    }
97
    
97
    
98
    public void testQuery() throws Exception {
98
    public void testQuery() throws Exception {
99
        BinaryForSourceQuery.Result result = BinaryForSourceQuery.findBinaryRoots(srcRoot1.getURL());
99
        BinaryForSourceQuery.Result result = BinaryForSourceQuery.findBinaryRoots(srcRoot1.toURL());
100
        assertEquals(0,result.getRoots().length);        
100
        assertEquals(0,result.getRoots().length);        
101
        result = BinaryForSourceQuery.findBinaryRoots(srcRoot2.getURL());
101
        result = BinaryForSourceQuery.findBinaryRoots(srcRoot2.toURL());
102
        assertEquals(1,result.getRoots().length);
102
        assertEquals(1,result.getRoots().length);
103
        assertEquals(binaryRoot2.getURL(), result.getRoots()[0]);
103
        assertEquals(binaryRoot2.toURL(), result.getRoots()[0]);
104
    }
104
    }
105
    
105
    
106
    public static class SFBQImpl implements SourceForBinaryQueryImplementation {        
106
    public static class SFBQImpl implements SourceForBinaryQueryImplementation {        
(-)a/api.java.classpath/test/unit/src/org/netbeans/api/java/queries/SourceForBinaryQueryTest.java (-11 / +11 lines)
 Lines 97-115    Link Here 
97
        zos.closeEntry();
97
        zos.closeEntry();
98
        zos.close();
98
        zos.close();
99
        sr2 = FileUtil.getArchiveRoot(FileUtil.toFileObject(zf));
99
        sr2 = FileUtil.getArchiveRoot(FileUtil.toFileObject(zf));
100
        map.put(br1.getURL(), Collections.singletonList(sr1));
100
        map.put(br1.toURL(), Collections.singletonList(sr1));
101
        map.put(br2.getURL(), Collections.singletonList(sr2));
101
        map.put(br2.toURL(), Collections.singletonList(sr2));
102
    }
102
    }
103
    
103
    
104
    public void testSFBQImpl () throws Exception {
104
    public void testSFBQImpl () throws Exception {
105
        MockServices.setServices(LegacySFBQImpl.class);
105
        MockServices.setServices(LegacySFBQImpl.class);
106
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.getURL());
106
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.toURL());
107
        assertNotNull(res);
107
        assertNotNull(res);
108
        assertEquals(1, res.getRoots().length);
108
        assertEquals(1, res.getRoots().length);
109
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
109
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
110
        assertTrue(res.preferSources());
110
        assertTrue(res.preferSources());
111
        
111
        
112
        res = SourceForBinaryQuery.findSourceRoots2(br2.getURL());
112
        res = SourceForBinaryQuery.findSourceRoots2(br2.toURL());
113
        assertNotNull(res);
113
        assertNotNull(res);
114
        assertEquals(1, res.getRoots().length);
114
        assertEquals(1, res.getRoots().length);
115
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
115
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
 Lines 123-135    Link Here 
123
    
123
    
124
    public void testSFBQImpl2 () throws Exception {
124
    public void testSFBQImpl2 () throws Exception {
125
        MockServices.setServices(LeafSFBQImpl.class);
125
        MockServices.setServices(LeafSFBQImpl.class);
126
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.getURL());
126
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.toURL());
127
        assertNotNull(res);
127
        assertNotNull(res);
128
        assertEquals(1, res.getRoots().length);
128
        assertEquals(1, res.getRoots().length);
129
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
129
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
130
        assertFalse(res.preferSources());
130
        assertFalse(res.preferSources());
131
        
131
        
132
        res = SourceForBinaryQuery.findSourceRoots2(br2.getURL());
132
        res = SourceForBinaryQuery.findSourceRoots2(br2.toURL());
133
        assertNotNull(res);
133
        assertNotNull(res);
134
        assertEquals(1, res.getRoots().length);
134
        assertEquals(1, res.getRoots().length);
135
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
135
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
 Lines 146-158    Link Here 
146
    public void testSFBQDelegatingImpl () throws Exception {
146
    public void testSFBQDelegatingImpl () throws Exception {
147
        DelegatingSFBImpl.impl = new LegacySFBQImpl();
147
        DelegatingSFBImpl.impl = new LegacySFBQImpl();
148
        MockServices.setServices(DelegatingSFBImpl.class);
148
        MockServices.setServices(DelegatingSFBImpl.class);
149
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.getURL());
149
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.toURL());
150
        assertNotNull(res);
150
        assertNotNull(res);
151
        assertEquals(1, res.getRoots().length);
151
        assertEquals(1, res.getRoots().length);
152
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
152
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
153
        assertTrue(res.preferSources());
153
        assertTrue(res.preferSources());
154
        
154
        
155
        res = SourceForBinaryQuery.findSourceRoots2(br2.getURL());
155
        res = SourceForBinaryQuery.findSourceRoots2(br2.toURL());
156
        assertNotNull(res);
156
        assertNotNull(res);
157
        assertEquals(1, res.getRoots().length);
157
        assertEquals(1, res.getRoots().length);
158
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
158
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
 Lines 169-181    Link Here 
169
    public void testSFBQDelegatingImpl2 () throws Exception {
169
    public void testSFBQDelegatingImpl2 () throws Exception {
170
        DelegatingSFBImpl.impl = new LeafSFBQImpl();
170
        DelegatingSFBImpl.impl = new LeafSFBQImpl();
171
        MockServices.setServices(DelegatingSFBImpl.class);
171
        MockServices.setServices(DelegatingSFBImpl.class);
172
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.getURL());
172
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.toURL());
173
        assertNotNull(res);
173
        assertNotNull(res);
174
        assertEquals(1, res.getRoots().length);
174
        assertEquals(1, res.getRoots().length);
175
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
175
        assertEquals(Collections.singletonList(sr1), Arrays.asList(res.getRoots()));
176
        assertFalse(res.preferSources());
176
        assertFalse(res.preferSources());
177
        
177
        
178
        res = SourceForBinaryQuery.findSourceRoots2(br2.getURL());
178
        res = SourceForBinaryQuery.findSourceRoots2(br2.toURL());
179
        assertNotNull(res);
179
        assertNotNull(res);
180
        assertEquals(1, res.getRoots().length);
180
        assertEquals(1, res.getRoots().length);
181
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
181
        assertEquals(Collections.singletonList(sr2), Arrays.asList(res.getRoots()));
 Lines 191-197    Link Here 
191
    public void testListening () throws Exception {
191
    public void testListening () throws Exception {
192
        DelegatingSFBImpl.impl = new LeafSFBQImpl();
192
        DelegatingSFBImpl.impl = new LeafSFBQImpl();
193
        MockServices.setServices(DelegatingSFBImpl.class);
193
        MockServices.setServices(DelegatingSFBImpl.class);
194
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.getURL());
194
        SourceForBinaryQuery.Result2 res = SourceForBinaryQuery.findSourceRoots2(br1.toURL());
195
        final AtomicBoolean fired = new AtomicBoolean ();
195
        final AtomicBoolean fired = new AtomicBoolean ();
196
        ChangeListener l;
196
        ChangeListener l;
197
        res.addChangeListener( l = new ChangeListener() {
197
        res.addChangeListener( l = new ChangeListener() {
(-)a/api.xml/nbproject/project.xml (-18 / +18 lines)
 Lines 50-66    Link Here 
50
            <code-name-base>org.netbeans.api.xml</code-name-base>
50
            <code-name-base>org.netbeans.api.xml</code-name-base>
51
            <module-dependencies>
51
            <module-dependencies>
52
                <dependency>
52
                <dependency>
53
                    <code-name-base>org.openide.filesystems</code-name-base>
54
                    <build-prerequisite/>
55
                    <compile-dependency/>
56
                    <run-dependency>
57
                        <specification-version>7.57</specification-version>
58
                    </run-dependency>
59
                </dependency>
60
                <dependency>
53
                    <code-name-base>org.openide.loaders</code-name-base>
61
                    <code-name-base>org.openide.loaders</code-name-base>
54
                    <build-prerequisite/>
62
                    <build-prerequisite/>
55
                    <compile-dependency/>
63
                    <compile-dependency/>
56
                    <run-dependency/>
64
                    <run-dependency/>
57
                </dependency>
65
                </dependency>
58
                <dependency>
66
                <dependency>
59
                    <code-name-base>org.openide.filesystems</code-name-base>
67
                    <code-name-base>org.openide.nodes</code-name-base>
60
                    <build-prerequisite/>
68
                    <build-prerequisite/>
61
                    <compile-dependency/>
69
                    <compile-dependency/>
62
                    <run-dependency>
70
                    <run-dependency>
63
                        <specification-version>6.2</specification-version>
71
                        <specification-version>7.23</specification-version>
72
                    </run-dependency>
73
                </dependency>
74
                <dependency>
75
                    <code-name-base>org.openide.text</code-name-base>
76
                    <build-prerequisite/>
77
                    <compile-dependency/>
78
                    <run-dependency>
79
                        <specification-version>6.16</specification-version>
64
                    </run-dependency>
80
                    </run-dependency>
65
                </dependency>
81
                </dependency>
66
                <dependency>
82
                <dependency>
 Lines 79-100    Link Here 
79
                        <specification-version>8.0</specification-version>
95
                        <specification-version>8.0</specification-version>
80
                    </run-dependency>
96
                    </run-dependency>
81
                </dependency>
97
                </dependency>
82
                <dependency>
83
                    <code-name-base>org.openide.nodes</code-name-base>
84
                    <build-prerequisite/>
85
                    <compile-dependency/>
86
                    <run-dependency>
87
                        <specification-version>7.23</specification-version>
88
                    </run-dependency>
89
                </dependency>
90
                <dependency>
91
                    <code-name-base>org.openide.text</code-name-base>
92
                    <build-prerequisite/>
93
                    <compile-dependency/>
94
                    <run-dependency>
95
                        <specification-version>6.16</specification-version>
96
                    </run-dependency>
97
                </dependency>
98
            </module-dependencies>
98
            </module-dependencies>
99
            <test-dependencies>
99
            <test-dependencies>
100
                <test-type>
100
                <test-type>
(-)a/api.xml/src/org/netbeans/api/xml/parsers/DocumentInputSource.java (-7 / +1 lines)
 Lines 46-52    Link Here 
46
46
47
import java.io.*;
47
import java.io.*;
48
import java.net.URL;
48
import java.net.URL;
49
import java.util.*;
50
49
51
import javax.swing.text.Document;
50
import javax.swing.text.Document;
52
51
 Lines 112-126    Link Here 
112
        if (system == null) {
111
        if (system == null) {
113
            Object obj = doc.getProperty(Document.StreamDescriptionProperty);        
112
            Object obj = doc.getProperty(Document.StreamDescriptionProperty);        
114
            if (obj instanceof DataObject) {
113
            if (obj instanceof DataObject) {
115
                try { 
116
                        DataObject dobj = (DataObject) obj;
114
                        DataObject dobj = (DataObject) obj;
117
                        FileObject fo = dobj.getPrimaryFile();
115
                        FileObject fo = dobj.getPrimaryFile();
118
                        URL url = fo.getURL();
116
                        URL url = fo.toURL();
119
                        system = url.toExternalForm();
117
                        system = url.toExternalForm();
120
                } catch (IOException io) {
121
                    ErrorManager emgr = (ErrorManager) Lookup.getDefault().lookup(ErrorManager.class);
122
                    emgr.notify(io);
123
                }
124
            } else {
118
            } else {
125
                ErrorManager emgr = (ErrorManager) Lookup.getDefault().lookup(ErrorManager.class);
119
                ErrorManager emgr = (ErrorManager) Lookup.getDefault().lookup(ErrorManager.class);
126
                emgr.log("XML:DocumentInputSource:Unknown stream description:" + obj);
120
                emgr.log("XML:DocumentInputSource:Unknown stream description:" + obj);
(-)a/api.xml/src/org/netbeans/spi/xml/cookies/DataObjectAdapters.java (-23 / +1 lines)
 Lines 45-53    Link Here 
45
package org.netbeans.spi.xml.cookies;
45
package org.netbeans.spi.xml.cookies;
46
46
47
import java.io.Reader;
47
import java.io.Reader;
48
import java.net.URI;
49
import java.net.URISyntaxException;
50
import java.net.URL;
51
import javax.swing.text.Document;
48
import javax.swing.text.Document;
52
import javax.xml.parsers.ParserConfigurationException;
49
import javax.xml.parsers.ParserConfigurationException;
53
import javax.xml.parsers.SAXParser;
50
import javax.xml.parsers.SAXParser;
 Lines 57-64    Link Here 
57
import org.netbeans.api.xml.parsers.DocumentInputSource;
54
import org.netbeans.api.xml.parsers.DocumentInputSource;
58
import org.netbeans.api.xml.services.UserCatalog;
55
import org.netbeans.api.xml.services.UserCatalog;
59
import org.openide.cookies.EditorCookie;
56
import org.openide.cookies.EditorCookie;
60
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileStateInvalidException;
62
import org.openide.loaders.DataObject;
57
import org.openide.loaders.DataObject;
63
import org.xml.sax.EntityResolver;
58
import org.xml.sax.EntityResolver;
64
import org.xml.sax.InputSource;
59
import org.xml.sax.InputSource;
 Lines 179-202    Link Here 
179
     * @return system Id of <code>dataObject</code>
174
     * @return system Id of <code>dataObject</code>
180
     */
175
     */
181
    private static String getSystemId (DataObject dataObject) {
176
    private static String getSystemId (DataObject dataObject) {
182
        String systemId = null;
177
        return dataObject.getPrimaryFile().toURI().toASCIIString();
183
        try {
184
            FileObject fileObject = dataObject.getPrimaryFile();
185
            URL url = fileObject.getURL();
186
            try {
187
                systemId = new URI(url.toString()).toASCIIString();
188
            } catch (URISyntaxException ex) {
189
                // if cannot be converted to URI, return at least external form
190
                // instead of returning null
191
                systemId = url.toExternalForm();
192
                Util.THIS.debug(ex);
193
            }
194
        } catch (FileStateInvalidException exc) {
195
            if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug (exc);
196
197
            // nothing to do -> return null; //???
198
        }
199
        return systemId;
200
    }
178
    }
201
179
202
    private static synchronized SAXParserFactory getSAXParserFactory () throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
180
    private static synchronized SAXParserFactory getSAXParserFactory () throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException {
(-)a/api.xml/src/org/netbeans/spi/xml/cookies/SharedXMLSupport.java (-6 lines)
 Lines 54-60    Link Here 
54
import javax.xml.parsers.SAXParser;
54
import javax.xml.parsers.SAXParser;
55
import javax.xml.parsers.SAXParserFactory;
55
import javax.xml.parsers.SAXParserFactory;
56
56
57
import org.openide.filesystems.FileStateInvalidException;
58
57
59
import org.xml.sax.*;
58
import org.xml.sax.*;
60
import org.xml.sax.helpers.DefaultHandler;
59
import org.xml.sax.helpers.DefaultHandler;
 Lines 239-249    Link Here 
239
            // same as one catched by ErrorHandler
238
            // same as one catched by ErrorHandler
240
            // because we do not have content handler
239
            // because we do not have content handler
241
240
242
        } catch (FileStateInvalidException ex) {
243
244
            // bad luck report as fatal error
245
            handler.fatalError(new SAXParseException(ex.getLocalizedMessage(), locator, ex));
246
247
        } catch (IOException ex) {
241
        } catch (IOException ex) {
248
242
249
            // bad luck probably because cannot resolve entity
243
            // bad luck probably because cannot resolve entity
(-)a/apisupport.ant/nbproject/project.xml (-1 / +1 lines)
 Lines 259-265    Link Here 
259
                    <build-prerequisite/>
259
                    <build-prerequisite/>
260
                    <compile-dependency/>
260
                    <compile-dependency/>
261
                    <run-dependency>
261
                    <run-dependency>
262
                        <specification-version>7.46</specification-version>
262
                        <specification-version>7.57</specification-version>
263
                    </run-dependency>
263
                    </run-dependency>
264
                </dependency>
264
                </dependency>
265
                <dependency>
265
                <dependency>
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/NbModuleProviderImpl.java (-1 / +1 lines)
 Lines 194-200    Link Here 
194
                    if (src != null) {
194
                    if (src != null) {
195
                        FileObject layerXml = src.getFileObject(layer);
195
                        FileObject layerXml = src.getFileObject(layer);
196
                        if (layerXml != null) {
196
                        if (layerXml != null) {
197
                            otherLayerURLs.add(layerXml.getURL());
197
                            otherLayerURLs.add(layerXml.toURL());
198
                        }
198
                        }
199
                    }
199
                    }
200
                }
200
                }
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java (-33 / +8 lines)
 Lines 72-80    Link Here 
72
import org.netbeans.spi.project.support.ant.AntProjectEvent;
72
import org.netbeans.spi.project.support.ant.AntProjectEvent;
73
import org.netbeans.spi.project.support.ant.AntProjectListener;
73
import org.netbeans.spi.project.support.ant.AntProjectListener;
74
import org.netbeans.spi.project.support.ant.PropertyUtils;
74
import org.netbeans.spi.project.support.ant.PropertyUtils;
75
import org.openide.ErrorManager;
76
import org.openide.filesystems.FileObject;
75
import org.openide.filesystems.FileObject;
77
import org.openide.filesystems.FileStateInvalidException;
78
import org.openide.filesystems.FileUtil;
76
import org.openide.filesystems.FileUtil;
79
import org.openide.util.WeakListeners;
77
import org.openide.util.WeakListeners;
80
import org.openide.xml.XMLUtil;
78
import org.openide.xml.XMLUtil;
 Lines 128-140    Link Here 
128
        URL generatedClasses = FileUtil.urlForArchiveOrDir(project.getGeneratedClassesDirectory());
126
        URL generatedClasses = FileUtil.urlForArchiveOrDir(project.getGeneratedClassesDirectory());
129
        URL generatedUnitTestClasses = FileUtil.urlForArchiveOrDir(project.getTestGeneratedClassesDirectory("unit"));
127
        URL generatedUnitTestClasses = FileUtil.urlForArchiveOrDir(project.getTestGeneratedClassesDirectory("unit"));
130
        URL generatedFunctionalTestClasses = FileUtil.urlForArchiveOrDir(project.getTestGeneratedClassesDirectory("qa-functional"));
128
        URL generatedFunctionalTestClasses = FileUtil.urlForArchiveOrDir(project.getTestGeneratedClassesDirectory("qa-functional"));
131
        String fileU;
129
        String fileU = file.toURL().toString();
132
        try {
133
            fileU = file.getURL().toString();
134
        } catch (FileStateInvalidException x) {
135
            LOG.log(Level.INFO, null, x);
136
            return null;
137
        }
138
        if (srcDir != null &&
130
        if (srcDir != null &&
139
                (FileUtil.isParentOf(srcDir, file) || file == srcDir || fileU.startsWith(generatedClasses.toString()))) {
131
                (FileUtil.isParentOf(srcDir, file) || file == srcDir || fileU.startsWith(generatedClasses.toString()))) {
140
            // Regular sources.
132
            // Regular sources.
 Lines 151-161    Link Here 
151
                return execute;
143
                return execute;
152
            } else if (type.equals(ClassPath.SOURCE)) {
144
            } else if (type.equals(ClassPath.SOURCE)) {
153
                if (source == null) {
145
                if (source == null) {
154
                    try {
146
                    source = ClassPathSupport.createClassPath(srcDir.toURL(), generatedClasses);
155
                        source = ClassPathSupport.createClassPath(srcDir.getURL(), generatedClasses);
156
                    } catch (FileStateInvalidException x) {
157
                        LOG.log(Level.INFO, null, x);
158
                    }
159
                }
147
                }
160
                return source;
148
                return source;
161
            }
149
            }
 Lines 177-187    Link Here 
177
                return testExecute;
165
                return testExecute;
178
            } else if (type.equals(ClassPath.SOURCE)) {
166
            } else if (type.equals(ClassPath.SOURCE)) {
179
                if (testSource == null) {
167
                if (testSource == null) {
180
                    try {
168
                    testSource = ClassPathSupport.createClassPath(testSrcDir.toURL(), generatedUnitTestClasses);
181
                        testSource = ClassPathSupport.createClassPath(testSrcDir.getURL(), generatedUnitTestClasses);
182
                    } catch (FileStateInvalidException x) {
183
                        LOG.log(Level.INFO, null, x);
184
                    }
185
                }
169
                }
186
                return testSource;
170
                return testSource;
187
            }
171
            }
 Lines 190-200    Link Here 
190
            // Functional tests.
174
            // Functional tests.
191
            if (type.equals(ClassPath.SOURCE)) {
175
            if (type.equals(ClassPath.SOURCE)) {
192
                if (funcTestSource == null) {
176
                if (funcTestSource == null) {
193
                    try {
177
                    funcTestSource = ClassPathSupport.createClassPath(funcTestSrcDir.toURL(), generatedFunctionalTestClasses);
194
                        funcTestSource = ClassPathSupport.createClassPath(funcTestSrcDir.getURL(), generatedFunctionalTestClasses);
195
                    } catch (FileStateInvalidException x) {
196
                        LOG.log(Level.INFO, null, x);
197
                    }
198
                }
178
                }
199
                return funcTestSource;
179
                return funcTestSource;
200
            } else if (type.equals(ClassPath.COMPILE)) {
180
            } else if (type.equals(ClassPath.COMPILE)) {
 Lines 212-226    Link Here 
212
            }
192
            }
213
        } else if (classesDir != null && (classesDir.equals(file) || FileUtil.isParentOf(classesDir,file))) {
193
        } else if (classesDir != null && (classesDir.equals(file) || FileUtil.isParentOf(classesDir,file))) {
214
            if (ClassPath.EXECUTE.equals(type)) {
194
            if (ClassPath.EXECUTE.equals(type)) {
215
                try {
195
                List<PathResourceImplementation> roots = new ArrayList<PathResourceImplementation>();
216
                    List<PathResourceImplementation> roots = new ArrayList<PathResourceImplementation>();
196
                roots.add ( ClassPathSupport.createResource(classesDir.toURL()));
217
                    roots.add ( ClassPathSupport.createResource(classesDir.getURL()));
197
                roots.addAll(createCompileClasspath().getResources());
218
                    roots.addAll(createCompileClasspath().getResources());
198
                return ClassPathSupport.createClassPath (roots);
219
                    return ClassPathSupport.createClassPath (roots);
220
                } catch (FileStateInvalidException e) {
221
                    ErrorManager.getDefault().notify (e);
222
                    return null;
223
                }
224
            }
199
            }
225
        } else if (testClassesDir != null && (testClassesDir.equals(file) || FileUtil.isParentOf(testClassesDir,file))) {
200
        } else if (testClassesDir != null && (testClassesDir.equals(file) || FileUtil.isParentOf(testClassesDir,file))) {
226
            if (ClassPath.EXECUTE.equals(type)) {
201
            if (ClassPath.EXECUTE.equals(type)) {
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/ActionFilterNode.java (-14 / +4 lines)
 Lines 50-62    Link Here 
50
import java.util.logging.Level;
50
import java.util.logging.Level;
51
import java.util.logging.Logger;
51
import java.util.logging.Logger;
52
import javax.swing.Action;
52
import javax.swing.Action;
53
import org.openide.ErrorManager;
54
import org.openide.actions.EditAction;
53
import org.openide.actions.EditAction;
55
import org.openide.actions.FindAction;
54
import org.openide.actions.FindAction;
56
import org.openide.loaders.DataObject;
55
import org.openide.loaders.DataObject;
57
import org.openide.actions.OpenAction;
56
import org.openide.actions.OpenAction;
58
import org.openide.filesystems.FileObject;
57
import org.openide.filesystems.FileObject;
59
import org.openide.filesystems.FileStateInvalidException;
60
import org.openide.filesystems.FileUtil;
58
import org.openide.filesystems.FileUtil;
61
import org.openide.nodes.FilterNode;
59
import org.openide.nodes.FilterNode;
62
import org.openide.nodes.Node;
60
import org.openide.nodes.Node;
 Lines 204-222    Link Here 
204
        }
202
        }
205
        
203
        
206
        public boolean hasJavadoc() {
204
        public boolean hasJavadoc() {
207
            try {
205
            boolean rNotNull = resource != null;
208
                boolean rNotNull = resource != null;
206
            int jLength = JavadocForBinaryQuery.findJavadoc(cpRoot.toURL()).getRoots().length;
209
                int jLength = JavadocForBinaryQuery.findJavadoc(cpRoot.getURL()).getRoots().length;
207
            return  rNotNull && jLength > 0;
210
                return  rNotNull && jLength > 0;
211
            } catch (FileStateInvalidException fsi) {
212
                return false;
213
            }
214
        }
208
        }
215
        
209
        
216
        public void showJavadoc() {
210
        public void showJavadoc() {
217
            try {
218
                String relativeName = FileUtil.getRelativePath(cpRoot, resource);
211
                String relativeName = FileUtil.getRelativePath(cpRoot, resource);
219
                URL[] urls = JavadocForBinaryQuery.findJavadoc(cpRoot.getURL()).getRoots();
212
                URL[] urls = JavadocForBinaryQuery.findJavadoc(cpRoot.toURL()).getRoots();
220
                URL pageURL;
213
                URL pageURL;
221
                if (relativeName.length() == 0) {
214
                if (relativeName.length() == 0) {
222
                    pageURL = ShowJavadocAction.findJavadoc("overview-summary.html",urls); //NOI18N
215
                    pageURL = ShowJavadocAction.findJavadoc("overview-summary.html",urls); //NOI18N
 Lines 231-239    Link Here 
231
                    pageURL = ShowJavadocAction.findJavadoc(javadocFileName, urls);
224
                    pageURL = ShowJavadocAction.findJavadoc(javadocFileName, urls);
232
                }
225
                }
233
                ShowJavadocAction.showJavaDoc(pageURL,relativeName.replace('/','.'));  //NOI18N
226
                ShowJavadocAction.showJavaDoc(pageURL,relativeName.replace('/','.'));  //NOI18N
234
            } catch (FileStateInvalidException fsi) {
235
                ErrorManager.getDefault().notify(fsi);
236
            }
237
        }
227
        }
238
        
228
        
239
    }
229
    }
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/LibrariesSourceGroup.java (-8 / +1 lines)
 Lines 47-55    Link Here 
47
import java.beans.PropertyChangeListener;
47
import java.beans.PropertyChangeListener;
48
import javax.swing.Icon;
48
import javax.swing.Icon;
49
import org.netbeans.api.project.SourceGroup;
49
import org.netbeans.api.project.SourceGroup;
50
import org.openide.ErrorManager;
51
import org.openide.filesystems.FileObject;
50
import org.openide.filesystems.FileObject;
52
import org.openide.filesystems.FileStateInvalidException;
53
import org.openide.filesystems.FileUtil;
51
import org.openide.filesystems.FileUtil;
54
52
55
// XXX this class is more or less copy-pasted from j2seproject.
53
// XXX this class is more or less copy-pasted from j2seproject.
 Lines 88-99    Link Here 
88
    }
86
    }
89
    
87
    
90
    public String getName() {
88
    public String getName() {
91
        try {
89
        return root.toURL().toExternalForm();
92
            return root.getURL().toExternalForm();
93
        } catch (FileStateInvalidException fsi) {
94
            ErrorManager.getDefault().notify(fsi);
95
            return root.toString();
96
        }
97
    }
90
    }
98
    
91
    
99
    public String getDisplayName() {
92
    public String getDisplayName() {
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/PlatformNode.java (-8 / +1 lines)
 Lines 58-70    Link Here 
58
import java.util.Set;
58
import java.util.Set;
59
import javax.swing.Action;
59
import javax.swing.Action;
60
import javax.swing.Icon;
60
import javax.swing.Icon;
61
import javax.swing.ImageIcon;
62
import javax.swing.event.ChangeEvent;
61
import javax.swing.event.ChangeEvent;
63
import javax.swing.event.ChangeListener;
62
import javax.swing.event.ChangeListener;
64
import org.netbeans.api.java.classpath.ClassPath;
63
import org.netbeans.api.java.classpath.ClassPath;
65
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
64
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
66
import org.openide.filesystems.FileObject;
65
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileStateInvalidException;
68
import org.openide.filesystems.FileUtil;
66
import org.openide.filesystems.FileUtil;
69
import org.openide.nodes.Children;
67
import org.openide.nodes.Children;
70
import org.openide.nodes.AbstractNode;
68
import org.openide.nodes.AbstractNode;
 Lines 72-78    Link Here 
72
import org.openide.util.ImageUtilities;
70
import org.openide.util.ImageUtilities;
73
import org.openide.util.NbBundle;
71
import org.openide.util.NbBundle;
74
import org.openide.util.RequestProcessor;
72
import org.openide.util.RequestProcessor;
75
import org.openide.util.Utilities;
76
import org.openide.util.WeakListeners;
73
import org.openide.util.WeakListeners;
77
import org.openide.ErrorManager;
74
import org.openide.ErrorManager;
78
import org.netbeans.api.java.platform.JavaPlatform;
75
import org.netbeans.api.java.platform.JavaPlatform;
 Lines 205-214    Link Here 
205
            FileObject[] roots = platform.getBootstrapLibraries().getRoots();
202
            FileObject[] roots = platform.getBootstrapLibraries().getRoots();
206
            List<SourceGroup> result = new ArrayList<SourceGroup>(roots.length);
203
            List<SourceGroup> result = new ArrayList<SourceGroup>(roots.length);
207
            for (int i=0; i<roots.length; i++) {
204
            for (int i=0; i<roots.length; i++) {
208
                try {
209
                    FileObject file;
205
                    FileObject file;
210
                    Icon icon;
206
                    Icon icon;
211
                    if ("jar".equals(roots[i].getURL().getProtocol())) { //NOI18N
207
                    if ("jar".equals(roots[i].toURL().getProtocol())) { //NOI18N
212
                        file = FileUtil.getArchiveFile(roots[i]);
208
                        file = FileUtil.getArchiveFile(roots[i]);
213
                        icon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
209
                        icon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
214
                    } else {
210
                    } else {
 Lines 218-226    Link Here 
218
                    if (file.isValid()) {
214
                    if (file.isValid()) {
219
                        result.add(new LibrariesSourceGroup(roots[i], file.getNameExt(), icon, icon));
215
                        result.add(new LibrariesSourceGroup(roots[i], file.getNameExt(), icon, icon));
220
                    }
216
                    }
221
                } catch (FileStateInvalidException e) {
222
                    ErrorManager.getDefault().notify(e);
223
                }
224
            }
217
            }
225
            return result;
218
            return result;
226
        }
219
        }
(-)a/apisupport.ant/src/org/netbeans/modules/apisupport/project/universe/TestEntry.java (-1 / +1 lines)
 Lines 153-159    Link Here 
153
                        if (nbm != null && nbm.getCodeNameBase().equals(getCodeNameBase())) {
153
                        if (nbm != null && nbm.getCodeNameBase().equals(getCodeNameBase())) {
154
                            FileObject file = nbm.getTestSourceDirectory(testType);
154
                            FileObject file = nbm.getTestSourceDirectory(testType);
155
                            if (file != null) {
155
                            if (file != null) {
156
                                return file.getURL();
156
                                return file.toURL();
157
                            }
157
                            }
158
                        }
158
                        }
159
                    }
159
                    }
(-)a/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/queries/ModuleProjectClassPathExtenderTest.java (-4 / +4 lines)
 Lines 106-112    Link Here 
106
        FileObject testsrc = clientprj.getTestSourceDirectory("unit");
106
        FileObject testsrc = clientprj.getTestSourceDirectory("unit");
107
        assertTrue(ProjectClassPathModifier.addLibraries(new Library[] {testlib}, testsrc, ClassPath.COMPILE));
107
        assertTrue(ProjectClassPathModifier.addLibraries(new Library[] {testlib}, testsrc, ClassPath.COMPILE));
108
        assertFalse(ProjectClassPathModifier.addLibraries(new Library[] {testlib}, testsrc, ClassPath.COMPILE));
108
        assertFalse(ProjectClassPathModifier.addLibraries(new Library[] {testlib}, testsrc, ClassPath.COMPILE));
109
        InputSource input = new InputSource(clientprj.getProjectDirectory().getFileObject("nbproject/project.xml").getURL().toString());
109
        InputSource input = new InputSource(clientprj.getProjectDirectory().getFileObject("nbproject/project.xml").toURL().toString());
110
        XPath xpath = XPathFactory.newInstance().newXPath();
110
        XPath xpath = XPathFactory.newInstance().newXPath();
111
        xpath.setNamespaceContext(nbmNamespaceContext());
111
        xpath.setNamespaceContext(nbmNamespaceContext());
112
        assertEquals("org.example.client", xpath.evaluate("//nbm:data/nbm:code-name-base", input)); // control
112
        assertEquals("org.example.client", xpath.evaluate("//nbm:data/nbm:code-name-base", input)); // control
 Lines 118-135    Link Here 
118
        NbModuleProject prj = TestBase.generateStandaloneModule(getWorkDir(), "module");
118
        NbModuleProject prj = TestBase.generateStandaloneModule(getWorkDir(), "module");
119
        FileObject src = prj.getSourceDirectory();
119
        FileObject src = prj.getSourceDirectory();
120
        FileObject jar = TestFileUtils.writeZipFile(FileUtil.toFileObject(getWorkDir()), "a.jar", "entry:contents");
120
        FileObject jar = TestFileUtils.writeZipFile(FileUtil.toFileObject(getWorkDir()), "a.jar", "entry:contents");
121
        URL root = FileUtil.getArchiveRoot(jar.getURL());
121
        URL root = FileUtil.getArchiveRoot(jar.toURL());
122
        assertTrue(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
122
        assertTrue(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
123
        assertFalse(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
123
        assertFalse(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
124
        FileObject releaseModulesExt = prj.getProjectDirectory().getFileObject("release/modules/ext");
124
        FileObject releaseModulesExt = prj.getProjectDirectory().getFileObject("release/modules/ext");
125
        assertNotNull(releaseModulesExt);
125
        assertNotNull(releaseModulesExt);
126
        assertNotNull(releaseModulesExt.getFileObject("a.jar"));
126
        assertNotNull(releaseModulesExt.getFileObject("a.jar"));
127
        jar = TestFileUtils.writeZipFile(releaseModulesExt, "b.jar", "entry2:contents");
127
        jar = TestFileUtils.writeZipFile(releaseModulesExt, "b.jar", "entry2:contents");
128
        root = FileUtil.getArchiveRoot(jar.getURL());
128
        root = FileUtil.getArchiveRoot(jar.toURL());
129
        assertTrue(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
129
        assertTrue(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
130
        assertFalse(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
130
        assertFalse(ProjectClassPathModifier.addRoots(new URL[] {root}, src, ClassPath.COMPILE));
131
        assertEquals(2, releaseModulesExt.getChildren().length);
131
        assertEquals(2, releaseModulesExt.getChildren().length);
132
        String projectXml = prj.getProjectDirectory().getFileObject("nbproject/project.xml").getURL().toString();
132
        String projectXml = prj.getProjectDirectory().getFileObject("nbproject/project.xml").toURL().toString();
133
        InputSource input = new InputSource(projectXml);
133
        InputSource input = new InputSource(projectXml);
134
        XPath xpath = XPathFactory.newInstance().newXPath();
134
        XPath xpath = XPathFactory.newInstance().newXPath();
135
        xpath.setNamespaceContext(nbmNamespaceContext());
135
        xpath.setNamespaceContext(nbmNamespaceContext());
(-)a/apisupport.ant/test/unit/src/org/netbeans/modules/apisupport/project/queries/SubprojectProviderImplTest.java (-1 / +1 lines)
 Lines 151-157    Link Here 
151
        }
151
        }
152
        SortedSet<String> actual = new TreeSet<String>();
152
        SortedSet<String> actual = new TreeSet<String>();
153
        for (Project sp : spp.getSubprojects()) {
153
        for (Project sp : spp.getSubprojects()) {
154
            actual.add(sp.getProjectDirectory().getURL().toExternalForm());
154
            actual.add(sp.getProjectDirectory().toURL().toExternalForm());
155
        }
155
        }
156
        assertEquals("correct subprojects for " + project, expected.toString(), actual.toString());
156
        assertEquals("correct subprojects for " + project, expected.toString(), actual.toString());
157
    }
157
    }
(-)a/apisupport.project/nbproject/project.xml (-1 / +1 lines)
 Lines 219-225    Link Here 
219
                    <build-prerequisite/>
219
                    <build-prerequisite/>
220
                    <compile-dependency/>
220
                    <compile-dependency/>
221
                    <run-dependency>
221
                    <run-dependency>
222
                        <specification-version>7.43</specification-version>
222
                        <specification-version>7.57</specification-version>
223
                    </run-dependency>
223
                    </run-dependency>
224
                </dependency>
224
                </dependency>
225
                <dependency>
225
                <dependency>
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/api/LayerHandle.java (-6 / +1 lines)
 Lines 67-73    Link Here 
67
import org.openide.filesystems.FileEvent;
67
import org.openide.filesystems.FileEvent;
68
import org.openide.filesystems.FileObject;
68
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileRenameEvent;
69
import org.openide.filesystems.FileRenameEvent;
70
import org.openide.filesystems.FileStateInvalidException;
71
import org.openide.filesystems.FileSystem;
70
import org.openide.filesystems.FileSystem;
72
import org.openide.filesystems.FileUtil;
71
import org.openide.filesystems.FileUtil;
73
import org.openide.filesystems.MultiFileSystem;
72
import org.openide.filesystems.MultiFileSystem;
 Lines 151-161    Link Here 
151
                    return fs = FileUtil.createMemoryFileSystem();
150
                    return fs = FileUtil.createMemoryFileSystem();
152
                }
151
                }
153
            }
152
            }
154
            try {
153
            fs = new DualLayers(new WritableXMLFileSystem(xml.toURL(), cookie = LayerUtils.cookieForFile(xml), LayerUtils.findResourceCP(project)));
155
                fs = new DualLayers(new WritableXMLFileSystem(xml.getURL(), cookie = LayerUtils.cookieForFile(xml), LayerUtils.findResourceCP(project)));
156
            } catch (FileStateInvalidException e) {
157
                throw new AssertionError(e);
158
            }
159
            cookie.addPropertyChangeListener(new PropertyChangeListener() {
154
            cookie.addPropertyChangeListener(new PropertyChangeListener() {
160
                public void propertyChange(PropertyChangeEvent evt) {
155
                public void propertyChange(PropertyChangeEvent evt) {
161
                    //System.err.println("changed in mem");
156
                    //System.err.println("changed in mem");
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/LayerUtils.java (-10 / +3 lines)
 Lines 64-70    Link Here 
64
import org.netbeans.api.project.ProjectUtils;
64
import org.netbeans.api.project.ProjectUtils;
65
import org.netbeans.api.project.SourceGroup;
65
import org.netbeans.api.project.SourceGroup;
66
import org.netbeans.api.project.Sources;
66
import org.netbeans.api.project.Sources;
67
import org.netbeans.modules.apisupport.project.api.Util;
68
import org.netbeans.modules.apisupport.project.api.LayerHandle;
67
import org.netbeans.modules.apisupport.project.api.LayerHandle;
69
import org.netbeans.modules.apisupport.project.spi.NbModuleProvider;
68
import org.netbeans.modules.apisupport.project.spi.NbModuleProvider;
70
import org.netbeans.modules.xml.tax.cookies.TreeEditorCookie;
69
import org.netbeans.modules.xml.tax.cookies.TreeEditorCookie;
 Lines 74-86    Link Here 
74
import org.netbeans.tax.TreeException;
73
import org.netbeans.tax.TreeException;
75
import org.netbeans.tax.TreeObject;
74
import org.netbeans.tax.TreeObject;
76
import org.netbeans.tax.io.TreeStreamResult;
75
import org.netbeans.tax.io.TreeStreamResult;
77
import org.openide.ErrorManager;
78
import org.openide.filesystems.FileAttributeEvent;
76
import org.openide.filesystems.FileAttributeEvent;
79
import org.openide.filesystems.FileChangeListener;
77
import org.openide.filesystems.FileChangeListener;
80
import org.openide.filesystems.FileEvent;
78
import org.openide.filesystems.FileEvent;
81
import org.openide.filesystems.FileObject;
79
import org.openide.filesystems.FileObject;
82
import org.openide.filesystems.FileRenameEvent;
80
import org.openide.filesystems.FileRenameEvent;
83
import org.openide.filesystems.FileStateInvalidException;
84
import org.openide.filesystems.FileSystem;
81
import org.openide.filesystems.FileSystem;
85
import org.openide.filesystems.FileSystem.AtomicAction;
82
import org.openide.filesystems.FileSystem.AtomicAction;
86
import org.openide.filesystems.FileUtil;
83
import org.openide.filesystems.FileUtil;
 Lines 125-137    Link Here 
125
        if (cp == null) {
122
        if (cp == null) {
126
            return new URL[] {u};
123
            return new URL[] {u};
127
        }
124
        }
128
        try {
129
            if (u.getProtocol().equals("nbres")) { // NOI18N
125
            if (u.getProtocol().equals("nbres")) { // NOI18N
130
                String path = u.getFile();
126
                String path = u.getFile();
131
                if (path.startsWith("/")) path = path.substring(1); // NOI18N
127
                if (path.startsWith("/")) path = path.substring(1); // NOI18N
132
                FileObject fo = cp.findResource(path);
128
                FileObject fo = cp.findResource(path);
133
                if (fo != null) {
129
                if (fo != null) {
134
                    return new URL[] {fo.getURL()};
130
                    return new URL[] {fo.toURL()};
135
                }
131
                }
136
            } else if (u.getProtocol().equals("nbresloc")) { // NOI18N
132
            } else if (u.getProtocol().equals("nbresloc")) { // NOI18N
137
                List<URL> urls = new ArrayList<URL>();
133
                List<URL> urls = new ArrayList<URL>();
 Lines 164-179    Link Here 
164
                    String trypath = folder + name + trysuffix + ext;
160
                    String trypath = folder + name + trysuffix + ext;
165
                    FileObject fo = cp.findResource(trypath);
161
                    FileObject fo = cp.findResource(trypath);
166
                    if (fo != null) {
162
                    if (fo != null) {
167
                        urls.add(fo.getURL());
163
                        urls.add(fo.toURL());
168
                    }
164
                    }
169
                }
165
                }
170
                if (!urls.isEmpty()) {
166
                if (!urls.isEmpty()) {
171
                    return urls.toArray(new URL[urls.size()]);
167
                    return urls.toArray(new URL[urls.size()]);
172
                }
168
                }
173
            }
169
            }
174
        } catch (FileStateInvalidException fsie) {
175
            Util.err.notify(ErrorManager.WARNING, fsie);
176
        }
177
        return new URL[] {u};
170
        return new URL[] {u};
178
    }
171
    }
179
172
 Lines 259-265    Link Here 
259
                    //System.err.println("openDocumentRoot: really opening");
252
                    //System.err.println("openDocumentRoot: really opening");
260
                    boolean oldDirty = dirty;
253
                    boolean oldDirty = dirty;
261
                    int oldStatus = getStatus();
254
                    int oldStatus = getStatus();
262
                    root = new XMLParsingSupport().parse(new InputSource(f.getURL().toExternalForm()));
255
                    root = new XMLParsingSupport().parse(new InputSource(f.toURL().toExternalForm()));
263
                    problem = null;
256
                    problem = null;
264
                    dirty = false;
257
                    dirty = false;
265
                    pcs.firePropertyChange(PROP_DIRTY, oldDirty, false);
258
                    pcs.firePropertyChange(PROP_DIRTY, oldDirty, false);
(-)a/apisupport.project/src/org/netbeans/modules/apisupport/project/layers/OpenLayerFilesAction.java (-7 / +2 lines)
 Lines 68-74    Link Here 
68
import org.openide.cookies.EditorCookie;
68
import org.openide.cookies.EditorCookie;
69
import org.openide.cookies.LineCookie;
69
import org.openide.cookies.LineCookie;
70
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileObject;
71
import org.openide.filesystems.FileStateInvalidException;
72
import org.openide.filesystems.FileUtil;
71
import org.openide.filesystems.FileUtil;
73
import org.openide.filesystems.URLMapper;
72
import org.openide.filesystems.URLMapper;
74
import org.openide.loaders.DataObject;
73
import org.openide.loaders.DataObject;
 Lines 96-112    Link Here 
96
    protected @Override void performAction(final Node[] activatedNodes) {
95
    protected @Override void performAction(final Node[] activatedNodes) {
97
        RequestProcessor.getDefault().post(new Runnable() {
96
        RequestProcessor.getDefault().post(new Runnable() {
98
            public @Override void run() {
97
            public @Override void run() {
99
                try {
100
                    FileObject f = activatedNodes[0].getCookie(DataObject.class).getPrimaryFile();
98
                    FileObject f = activatedNodes[0].getCookie(DataObject.class).getPrimaryFile();
101
                    openLayersForFile(f);
99
                    openLayersForFile(f);
102
                } catch (FileStateInvalidException ex) {
103
                    Exceptions.printStackTrace(ex);
104
                }
105
            }
100
            }
106
        });
101
        });
107
    }
102
    }
108
103
109
    private void openLayersForFile(FileObject f) throws FileStateInvalidException {
104
    private void openLayersForFile(FileObject f) {
110
        URL[] location = (URL[]) f.getAttribute("layers"); // NOI18N
105
        URL[] location = (URL[]) f.getAttribute("layers"); // NOI18N
111
        if (location != null) {
106
        if (location != null) {
112
            for (URL u : location) {
107
            for (URL u : location) {
 Lines 124-130    Link Here 
124
119
125
    private static void openLayerFileAndFind(DataObject layerDataObject, final FileObject originalF) {
120
    private static void openLayerFileAndFind(DataObject layerDataObject, final FileObject originalF) {
126
        try {
121
        try {
127
            InputSource in = new InputSource(layerDataObject.getPrimaryFile().getURL().toExternalForm());
122
            InputSource in = new InputSource(layerDataObject.getPrimaryFile().toURL().toExternalForm());
128
            SAXParserFactory factory = SAXParserFactory.newInstance();
123
            SAXParserFactory factory = SAXParserFactory.newInstance();
129
            SAXParser parser = factory.newSAXParser();
124
            SAXParser parser = factory.newSAXParser();
130
            final AtomicInteger line = new AtomicInteger();
125
            final AtomicInteger line = new AtomicInteger();
(-)a/apisupport.project/test/unit/src/org/netbeans/modules/apisupport/project/layers/WritableXMLFileSystemTest.java (-3 / +3 lines)
 Lines 122-128    Link Here 
122
        assertEquals(5L, x.getSize());
122
        assertEquals(5L, x.getSize());
123
        assertEquals("stuff", x.asText("UTF-8"));
123
        assertEquals("stuff", x.asText("UTF-8"));
124
        assertEquals("x.txt", x.getAttribute("WritableXMLFileSystem.url"));
124
        assertEquals("x.txt", x.getAttribute("WritableXMLFileSystem.url"));
125
        assertEquals("[" + l.f.getURL() + "]", Arrays.toString((URL[]) x.getAttribute("layers")));
125
        assertEquals("[" + l.f.toURL() + "]", Arrays.toString((URL[]) x.getAttribute("layers")));
126
        fs = new Layer("<file name='x' url='subdir/x.txt'/>", Collections.singletonMap("subdir/x.txt", "more stuff")).read();
126
        fs = new Layer("<file name='x' url='subdir/x.txt'/>", Collections.singletonMap("subdir/x.txt", "more stuff")).read();
127
        x = fs.findResource("x");
127
        x = fs.findResource("x");
128
        assertNotNull(x);
128
        assertNotNull(x);
 Lines 138-144    Link Here 
138
        FileObject orgTest = FileUtil.createFolder(new File(orig.folder, "org/test"));
138
        FileObject orgTest = FileUtil.createFolder(new File(orig.folder, "org/test"));
139
        FileObject lf = orig.f.copy(orgTest, "layer", "xml");
139
        FileObject lf = orig.f.copy(orgTest, "layer", "xml");
140
        SavableTreeEditorCookie cookie = LayerUtils.cookieForFile(lf);
140
        SavableTreeEditorCookie cookie = LayerUtils.cookieForFile(lf);
141
        FileSystem fs = new WritableXMLFileSystem(lf.getURL(), cookie, 
141
        FileSystem fs = new WritableXMLFileSystem(lf.toURL(), cookie,
142
                ClassPathSupport.createClassPath(new FileObject[] { FileUtil.toFileObject(orig.folder) } ));
142
                ClassPathSupport.createClassPath(new FileObject[] { FileUtil.toFileObject(orig.folder) } ));
143
        FileObject x = fs.findResource("x");
143
        FileObject x = fs.findResource("x");
144
        assertNotNull(x);
144
        assertNotNull(x);
 Lines 779-785    Link Here 
779
         */
779
         */
780
        public WritableXMLFileSystem read() throws Exception {
780
        public WritableXMLFileSystem read() throws Exception {
781
            cookie = LayerUtils.cookieForFile(f);
781
            cookie = LayerUtils.cookieForFile(f);
782
            return new WritableXMLFileSystem(f.getURL(), cookie, ClassPathSupport.createClassPath(System.getProperty("java.class.path")));
782
            return new WritableXMLFileSystem(f.toURL(), cookie, ClassPathSupport.createClassPath(System.getProperty("java.class.path")));
783
        }
783
        }
784
        /**
784
        /**
785
         * Write the filesystem to the layer and retrieve the new contents.
785
         * Write the filesystem to the layer and retrieve the new contents.
(-)a/apisupport.refactoring/nbproject/project.xml (-1 / +1 lines)
 Lines 202-208    Link Here 
202
                    <build-prerequisite/>
202
                    <build-prerequisite/>
203
                    <compile-dependency/>
203
                    <compile-dependency/>
204
                    <run-dependency>
204
                    <run-dependency>
205
                        <specification-version>6.2</specification-version>
205
                        <specification-version>7.57</specification-version>
206
                    </run-dependency>
206
                    </run-dependency>
207
                </dependency>
207
                </dependency>
208
                <dependency>
208
                <dependency>
(-)a/apisupport.refactoring/src/org/netbeans/modules/apisupport/hints/LayerHints.java (-9 / +1 lines)
 Lines 73-79    Link Here 
73
import org.openide.filesystems.FileChangeListener;
73
import org.openide.filesystems.FileChangeListener;
74
import org.openide.filesystems.FileEvent;
74
import org.openide.filesystems.FileEvent;
75
import org.openide.filesystems.FileObject;
75
import org.openide.filesystems.FileObject;
76
import org.openide.filesystems.FileStateInvalidException;
77
import org.openide.filesystems.FileSystem;
76
import org.openide.filesystems.FileSystem;
78
import org.openide.filesystems.FileUtil;
77
import org.openide.filesystems.FileUtil;
79
import org.openide.loaders.DataObject;
78
import org.openide.loaders.DataObject;
 Lines 181-194    Link Here 
181
                cancelAll();
180
                cancelAll();
182
                return;
181
                return;
183
            }
182
            }
184
            final URL layerURL;
183
            final URL layerURL = handle.getLayerFile().toURL();
185
            try {
186
                layerURL = handle.getLayerFile().getURL();
187
            } catch (FileStateInvalidException x) {
188
                LOG.log(Level.INFO, null, x);
189
                cancelAll();
190
                return;
191
            }
192
            String expectedLayers = "[" + layerURL + "]";
184
            String expectedLayers = "[" + layerURL + "]";
193
            List<ErrorDescription> errors = new ArrayList<ErrorDescription>();
185
            List<ErrorDescription> errors = new ArrayList<ErrorDescription>();
194
            RunnableFuture<Map<String,Integer>> linesFuture = new FutureTask<Map<String,Integer>>(new Callable<Map<String,Integer>>() {
186
            RunnableFuture<Map<String,Integer>> linesFuture = new FutureTask<Map<String,Integer>>(new Callable<Map<String,Integer>>() {
(-)a/apisupport.refactoring/src/org/netbeans/modules/apisupport/refactoring/NbWhereUsedRefactoringPlugin.java (-1 / +1 lines)
 Lines 214-220    Link Here 
214
                String text = doc.getText(0, doc.getLength());
214
                String text = doc.getText(0, doc.getLength());
215
                assert text.indexOf('\r') == -1; // should be in newline format only when a Document
215
                assert text.indexOf('\r') == -1; // should be in newline format only when a Document
216
                InputSource in = new InputSource(new StringReader(text));
216
                InputSource in = new InputSource(new StringReader(text));
217
                in.setSystemId(parentFile.getURL().toExternalForm());
217
                in.setSystemId(parentFile.toURL().toExternalForm());
218
                SAXParserFactory factory = SAXParserFactory.newInstance();
218
                SAXParserFactory factory = SAXParserFactory.newInstance();
219
                SAXParser parser = factory.newSAXParser();
219
                SAXParser parser = factory.newSAXParser();
220
                final int[] lineAndColStartAndEnd = new int[4];
220
                final int[] lineAndColStartAndEnd = new int[4];
(-)a/apisupport.refactoring/test/qa-functional/src/org/netbeans/modules/apisupport/refactoring/TestUtility.java (-2 / +1 lines)
 Lines 45-55    Link Here 
45
package org.netbeans.modules.apisupport.refactoring;
45
package org.netbeans.modules.apisupport.refactoring;
46
46
47
import java.io.File;
47
import java.io.File;
48
import org.openide.filesystems.FileStateInvalidException;
49
48
50
public class TestUtility {
49
public class TestUtility {
51
50
52
    public static File getFile(File dataDir,String projectName, String fileName) throws FileStateInvalidException {
51
    public static File getFile(File dataDir,String projectName, String fileName) {
53
        String result = dataDir.getAbsolutePath() +"/" + projectName + "/" + fileName;
52
        String result = dataDir.getAbsolutePath() +"/" + projectName + "/" + fileName;
54
        System.out.println("looking for file: " + result);
53
        System.out.println("looking for file: " + result);
55
        return new File(result);
54
        return new File(result);
(-)a/autoupdate.services/src/org/netbeans/modules/autoupdate/updateprovider/DummyModuleInfo.java (-6 / +1 lines)
 Lines 73-84    Link Here 
73
//                List urls = new ArrayList(Math.max(kids.length, 1)); // List<URL>
73
//                List urls = new ArrayList(Math.max(kids.length, 1)); // List<URL>
74
//                for (int i = 0; i < kids.length; i++) {
74
//                for (int i = 0; i < kids.length; i++) {
75
//                    if (kids[i].hasExt("xml")) {
75
//                    if (kids[i].hasExt("xml")) {
76
//                        try {
76
//                        urls.add(kids[i].toURL());
77
//                            urls.add(kids[i].getURL());
78
//                        }
79
//                        catch (FileStateInvalidException e) {
80
//                            Exceptions.printStackTrace(e);
81
//                        }
82
//                    }
77
//                    }
83
//                }
78
//                }
84
//                try {
79
//                try {
(-)a/core.startup/nbproject/project.xml (-1 / +1 lines)
 Lines 63-69    Link Here 
63
                    <build-prerequisite/>
63
                    <build-prerequisite/>
64
                    <compile-dependency/>
64
                    <compile-dependency/>
65
                    <run-dependency>
65
                    <run-dependency>
66
                        <specification-version>7.55</specification-version>
66
                        <specification-version>7.57</specification-version>
67
                    </run-dependency>
67
                    </run-dependency>
68
                </dependency>
68
                </dependency>
69
                <dependency>
69
                <dependency>
(-)a/core.startup/src/org/netbeans/core/startup/Main.java (-6 / +1 lines)
 Lines 58-64    Link Here 
58
import org.netbeans.Stamps;
58
import org.netbeans.Stamps;
59
import org.netbeans.Util;
59
import org.netbeans.Util;
60
import org.openide.filesystems.FileObject;
60
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileStateInvalidException;
62
import org.openide.filesystems.FileUtil;
61
import org.openide.filesystems.FileUtil;
63
import org.openide.filesystems.Repository;
62
import org.openide.filesystems.Repository;
64
import org.openide.modules.InstalledFileLocator;
63
import org.openide.modules.InstalledFileLocator;
 Lines 133-143    Link Here 
133
                        themeURL = null;
132
                        themeURL = null;
134
                    }
133
                    }
135
               } else {
134
               } else {
136
                    try {
135
                   themeURL = fo.toURL();
137
                        themeURL = fo.getURL();
138
                    } catch (FileStateInvalidException fsie) {
139
                        //do nothing
140
                    }
141
               }
136
               }
142
          }
137
          }
143
      } finally {
138
      } finally {
(-)a/core.startup/src/org/netbeans/core/startup/ModuleList.java (-2 / +2 lines)
 Lines 1275-1281    Link Here 
1275
                        InputStream is = xmlfile.getInputStream();
1275
                        InputStream is = xmlfile.getInputStream();
1276
                        try {
1276
                        try {
1277
                            InputSource src = new InputSource(is);
1277
                            InputSource src = new InputSource(is);
1278
                            src.setSystemId(xmlfile.getURL().toString());
1278
                            src.setSystemId(xmlfile.toURL().toString());
1279
                            try {
1279
                            try {
1280
                                dirtyprops.put(cnb, readStatus(src, null));
1280
                                dirtyprops.put(cnb, readStatus(src, null));
1281
                            } catch (SAXException saxe) {
1281
                            } catch (SAXException saxe) {
 Lines 1619-1625    Link Here 
1619
                                is = f.getInputStream();
1619
                                is = f.getInputStream();
1620
                                InputSource src = new InputSource(is);
1620
                                InputSource src = new InputSource(is);
1621
                                // Make sure any includes etc. are handled properly:
1621
                                // Make sure any includes etc. are handled properly:
1622
                                src.setSystemId(f.getURL().toExternalForm());
1622
                                src.setSystemId(f.toURL().toExternalForm());
1623
                                if (reader == null) {
1623
                                if (reader == null) {
1624
                                    try {
1624
                                    try {
1625
                                        reader = XMLUtil.createXMLReader();
1625
                                        reader = XMLUtil.createXMLReader();
(-)a/core.startup/src/org/netbeans/core/startup/NbInstaller.java (-9 / +1 lines)
 Lines 48-54    Link Here 
48
import java.io.DataOutputStream;
48
import java.io.DataOutputStream;
49
import java.io.File;
49
import java.io.File;
50
import java.io.IOException;
50
import java.io.IOException;
51
import java.lang.reflect.Method;
52
import java.net.URL;
51
import java.net.URL;
53
import java.nio.ByteBuffer;
52
import java.nio.ByteBuffer;
54
import java.util.ArrayList;
53
import java.util.ArrayList;
 Lines 78-89    Link Here 
78
import org.netbeans.Module;
77
import org.netbeans.Module;
79
import org.netbeans.ModuleInstaller;
78
import org.netbeans.ModuleInstaller;
80
import org.netbeans.ModuleManager;
79
import org.netbeans.ModuleManager;
81
import org.netbeans.ProxyClassLoader;
82
import org.netbeans.Stamps;
80
import org.netbeans.Stamps;
83
import org.netbeans.Util;
81
import org.netbeans.Util;
84
import org.netbeans.core.startup.layers.ModuleLayeredFileSystem;
82
import org.netbeans.core.startup.layers.ModuleLayeredFileSystem;
85
import org.openide.filesystems.FileObject;
83
import org.openide.filesystems.FileObject;
86
import org.openide.filesystems.FileStateInvalidException;
87
import org.openide.filesystems.FileUtil;
84
import org.openide.filesystems.FileUtil;
88
import org.openide.modules.Dependency;
85
import org.openide.modules.Dependency;
89
import org.openide.modules.ModuleInstall;
86
import org.openide.modules.ModuleInstall;
 Lines 92-98    Link Here 
92
import org.openide.util.NbCollections;
89
import org.openide.util.NbCollections;
93
import org.openide.util.SharedClassObject;
90
import org.openide.util.SharedClassObject;
94
import org.openide.util.NbBundle;
91
import org.openide.util.NbBundle;
95
import org.openide.util.Utilities;
96
import org.openide.util.lookup.InstanceContent;
92
import org.openide.util.lookup.InstanceContent;
97
import org.xml.sax.SAXException;
93
import org.xml.sax.SAXException;
98
94
 Lines 734-744    Link Here 
734
                List<URL> urls = new ArrayList<URL>(Math.max(kids.length, 1));
730
                List<URL> urls = new ArrayList<URL>(Math.max(kids.length, 1));
735
                for (FileObject kid : kids) {
731
                for (FileObject kid : kids) {
736
                    if (kid.hasExt("xml")) { // NOI18N
732
                    if (kid.hasExt("xml")) { // NOI18N
737
                        try {
733
                        urls.add(kid.toURL());
738
                            urls.add(kid.getURL());
739
                        } catch (FileStateInvalidException e) {
740
                            Util.err.log(Level.WARNING, null, e);
741
                        }
742
                    }
734
                    }
743
                }
735
                }
744
                try {
736
                try {
(-)a/java.api.common/nbproject/project.xml (-1 / +1 lines)
 Lines 174-180    Link Here 
174
                    <build-prerequisite/>
174
                    <build-prerequisite/>
175
                    <compile-dependency/>
175
                    <compile-dependency/>
176
                    <run-dependency>
176
                    <run-dependency>
177
                        <specification-version>7.20</specification-version>
177
                        <specification-version>7.57</specification-version>
178
                    </run-dependency>
178
                    </run-dependency>
179
                </dependency>
179
                </dependency>
180
                <dependency>
180
                <dependency>
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/applet/AppletSupport.java (-7 / +3 lines)
 Lines 164-170    Link Here 
164
            path = path.substring(0, path.length()-5);
164
            path = path.substring(0, path.length()-5);
165
            String codebase = FileUtil.getRelativePath(buildDir, classesDir);
165
            String codebase = FileUtil.getRelativePath(buildDir, classesDir);
166
            if (codebase == null) {
166
            if (codebase == null) {
167
                codebase = classesDir.getURL().toString();
167
                codebase = classesDir.toURL().toString();
168
            }
168
            }
169
            fillInFile(writer, path + "." + CLASS_EXT, "codebase=\"" + codebase + "\""); // NOI18N
169
            fillInFile(writer, path + "." + CLASS_EXT, "codebase=\"" + codebase + "\""); // NOI18N
170
        } finally {
170
        } finally {
 Lines 205-211    Link Here 
205
    /**
205
    /**
206
    * @return URL of the html file with the same name as sibling
206
    * @return URL of the html file with the same name as sibling
207
    */
207
    */
208
    public static URL generateHtmlFileURL(FileObject appletFile, FileObject buildDir, FileObject classesDir, String activePlatform) throws FileStateInvalidException {
208
    public static URL generateHtmlFileURL(FileObject appletFile, FileObject buildDir, FileObject classesDir, String activePlatform) {
209
        FileObject html = null;
209
        FileObject html = null;
210
        IOException ex = null;
210
        IOException ex = null;
211
        if ((appletFile == null) || (buildDir == null) || (classesDir == null)) {
211
        if ((appletFile == null) || (buildDir == null) || (classesDir == null)) {
 Lines 252-262    Link Here 
252
            }
252
            }
253
        }
253
        }
254
        else {
254
        else {
255
            try {
255
            url = htmlFile.toURL();
256
                url = htmlFile.getURL();
257
            } catch (FileStateInvalidException f) {
258
                ErrorManager.getDefault().notify(f);
259
            }
260
        }
256
        }
261
        return url;
257
        return url;
262
    }
258
    }
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/classpath/ClassPathExtender.java (-8 / +1 lines)
 Lines 46-52    Link Here 
46
46
47
import java.io.IOException;
47
import java.io.IOException;
48
import java.net.URI;
48
import java.net.URI;
49
import java.net.URISyntaxException;
50
49
51
import org.openide.filesystems.FileObject;
50
import org.openide.filesystems.FileObject;
52
import org.openide.filesystems.FileUtil;
51
import org.openide.filesystems.FileUtil;
 Lines 90-102    Link Here 
90
        }
89
        }
91
        URI[] archiveFileURIs = new URI[archiveFiles.length];
90
        URI[] archiveFileURIs = new URI[archiveFiles.length];
92
        for (int i = 0; i < archiveFiles.length; i++) {
91
        for (int i = 0; i < archiveFiles.length; i++) {
93
            try {
92
            archiveFileURIs[i] = archiveFiles[i].toURI();
94
                archiveFileURIs[i] = archiveFiles[i].getURL().toURI();
95
            } catch (URISyntaxException ex) {
96
                IOException ioe = new IOException();
97
                ioe.initCause(ex);
98
                throw ioe;
99
            }
100
        }        
93
        }        
101
        return this.delegate.handleRoots(archiveFileURIs, classPathId, projectXMLElementName, ClassPathModifier.ADD);
94
        return this.delegate.handleRoots(archiveFileURIs, classPathId, projectXMLElementName, ClassPathModifier.ADD);
102
    }
95
    }
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java (-4 lines)
 Lines 1668-1675    Link Here 
1668
            }
1668
            }
1669
            String activePlatformName = evaluator.getProperty("platform.active"); //NOI18N
1669
            String activePlatformName = evaluator.getProperty("platform.active"); //NOI18N
1670
            url = AppletSupport.generateHtmlFileURL(file, buildDir, classesDir, activePlatformName);
1670
            url = AppletSupport.generateHtmlFileURL(file, buildDir, classesDir, activePlatformName);
1671
        } catch (FileStateInvalidException fe) {
1672
            //ingore
1673
        } catch (IOException ioe) {
1671
        } catch (IOException ioe) {
1674
            ErrorManager.getDefault().notify(ioe);
1672
            ErrorManager.getDefault().notify(ioe);
1675
            return null;
1673
            return null;
 Lines 1707-1714    Link Here 
1707
                String activePlatformName = evaluator.getProperty("platform.active"); //NOI18N
1705
                String activePlatformName = evaluator.getProperty("platform.active"); //NOI18N
1708
                url = AppletSupport.getHTMLPageURL(targetHtml, activePlatformName);
1706
                url = AppletSupport.getHTMLPageURL(targetHtml, activePlatformName);
1709
            }
1707
            }
1710
        } catch (FileStateInvalidException fe) {
1711
            //ingore
1712
        } catch (IOException ioe) {
1708
        } catch (IOException ioe) {
1713
            ErrorManager.getDefault().notify(ioe);
1709
            ErrorManager.getDefault().notify(ioe);
1714
            return null;
1710
            return null;
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/ActionFilterNode.java (-16 / +3 lines)
 Lines 59-65    Link Here 
59
59
60
import org.openide.loaders.DataObject;
60
import org.openide.loaders.DataObject;
61
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileObject;
62
import org.openide.filesystems.FileStateInvalidException;
63
import org.openide.filesystems.FileUtil;
62
import org.openide.filesystems.FileUtil;
64
import org.openide.nodes.FilterNode;
63
import org.openide.nodes.FilterNode;
65
import org.openide.nodes.Node;
64
import org.openide.nodes.Node;
 Lines 391-401    Link Here 
391
                RP.execute(new Runnable() {
390
                RP.execute(new Runnable() {
392
                    @Override
391
                    @Override
393
                    public void run() {
392
                    public void run() {
394
                        try {
393
                        JavadocForBinaryQuery.findJavadoc(cpRoot.toURL());
395
                            JavadocForBinaryQuery.findJavadoc(cpRoot.getURL());
396
                        } catch (FileStateInvalidException ex) {
397
                            Exceptions.printStackTrace(ex);
398
                        }
399
                    }
394
                    }
400
                });
395
                });
401
            }
396
            }
 Lines 403-420    Link Here 
403
398
404
        @Override
399
        @Override
405
        public boolean hasJavadoc() {
400
        public boolean hasJavadoc() {
406
            try {
401
            return resource != null && JavadocForBinaryQuery.findJavadoc(cpRoot.toURL()).getRoots().length>0;
407
                return resource != null && JavadocForBinaryQuery.findJavadoc(cpRoot.getURL()).getRoots().length>0;
408
            } catch (FileStateInvalidException fsi) {
409
                return false;
410
            }
411
        }
402
        }
412
403
413
        @Override
404
        @Override
414
        public void showJavadoc() {
405
        public void showJavadoc() {
415
            try {
416
                String relativeName = FileUtil.getRelativePath(cpRoot,resource);
406
                String relativeName = FileUtil.getRelativePath(cpRoot,resource);
417
                URL[] urls = JavadocForBinaryQuery.findJavadoc(cpRoot.getURL()).getRoots();
407
                URL[] urls = JavadocForBinaryQuery.findJavadoc(cpRoot.toURL()).getRoots();
418
                URL pageURL;
408
                URL pageURL;
419
                if (relativeName.length()==0) {
409
                if (relativeName.length()==0) {
420
                    pageURL = ShowJavadocAction.findJavadoc ("overview-summary.html",urls); //NOI18N
410
                    pageURL = ShowJavadocAction.findJavadoc ("overview-summary.html",urls); //NOI18N
 Lines 431-439    Link Here 
431
                    pageURL = ShowJavadocAction.findJavadoc (javadocFileName,urls);
421
                    pageURL = ShowJavadocAction.findJavadoc (javadocFileName,urls);
432
                }
422
                }
433
                ShowJavadocAction.showJavaDoc(pageURL,relativeName.replace('/','.'));  //NOI18N
423
                ShowJavadocAction.showJavaDoc(pageURL,relativeName.replace('/','.'));  //NOI18N
434
            } catch (FileStateInvalidException fsi) {
435
                Exceptions.printStackTrace(fsi);
436
            }
437
        }
424
        }
438
    }
425
    }
439
426
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/LibrariesSourceGroup.java (-8 / +1 lines)
 Lines 47-56    Link Here 
47
import java.beans.PropertyChangeListener;
47
import java.beans.PropertyChangeListener;
48
import javax.swing.Icon;
48
import javax.swing.Icon;
49
import org.openide.filesystems.FileObject;
49
import org.openide.filesystems.FileObject;
50
import org.openide.filesystems.FileStateInvalidException;
51
import org.openide.filesystems.FileUtil;
50
import org.openide.filesystems.FileUtil;
52
import org.netbeans.api.project.SourceGroup;
51
import org.netbeans.api.project.SourceGroup;
53
import org.openide.util.Exceptions;
54
52
55
53
56
/**
54
/**
 Lines 96-107    Link Here 
96
    }
94
    }
97
95
98
    public String getName() {
96
    public String getName() {
99
        try {        
97
        return root.toURL().toExternalForm();
100
            return root.getURL().toExternalForm();
101
        } catch (FileStateInvalidException fsi) { 
102
            Exceptions.printStackTrace(fsi);
103
            return root.toString();
104
        }
105
    }
98
    }
106
99
107
    public String getDisplayName() {
100
    public String getDisplayName() {
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/project/ui/PlatformNode.java (-7 / +1 lines)
 Lines 65-71    Link Here 
65
import org.netbeans.api.java.classpath.ClassPath;
65
import org.netbeans.api.java.classpath.ClassPath;
66
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
66
import org.netbeans.api.java.queries.JavadocForBinaryQuery;
67
import org.openide.filesystems.FileObject;
67
import org.openide.filesystems.FileObject;
68
import org.openide.filesystems.FileStateInvalidException;
69
import org.openide.filesystems.FileUtil;
68
import org.openide.filesystems.FileUtil;
70
import org.openide.loaders.DataObjectNotFoundException;
69
import org.openide.loaders.DataObjectNotFoundException;
71
import org.openide.nodes.Children;
70
import org.openide.nodes.Children;
 Lines 84-90    Link Here 
84
import org.openide.loaders.DataFolder;
83
import org.openide.loaders.DataFolder;
85
import org.openide.loaders.DataObject;
84
import org.openide.loaders.DataObject;
86
import org.openide.util.ChangeSupport;
85
import org.openide.util.ChangeSupport;
87
import org.openide.util.Exceptions;
88
import org.openide.util.Lookup;
86
import org.openide.util.Lookup;
89
import org.openide.util.Parameters;
87
import org.openide.util.Parameters;
90
import org.openide.util.actions.SystemAction;
88
import org.openide.util.actions.SystemAction;
 Lines 240-250    Link Here 
240
            FileObject[] roots = platform.getBootstrapLibraries().getRoots();
238
            FileObject[] roots = platform.getBootstrapLibraries().getRoots();
241
            List<SourceGroup> result = new ArrayList<SourceGroup>(roots.length);
239
            List<SourceGroup> result = new ArrayList<SourceGroup>(roots.length);
242
            for (int i = 0; i < roots.length; i++) {
240
            for (int i = 0; i < roots.length; i++) {
243
                try {
244
                    FileObject file;
241
                    FileObject file;
245
                    Icon icon;
242
                    Icon icon;
246
                    Icon openedIcon;
243
                    Icon openedIcon;
247
                    if ("jar".equals(roots[i].getURL().getProtocol())) { //NOI18N
244
                    if ("jar".equals(roots[i].toURL().getProtocol())) { //NOI18N
248
                        file = FileUtil.getArchiveFile (roots[i]);
245
                        file = FileUtil.getArchiveFile (roots[i]);
249
                        icon = openedIcon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
246
                        icon = openedIcon = ImageUtilities.loadImageIcon(ARCHIVE_ICON, false);
250
                    }
247
                    }
 Lines 257-265    Link Here 
257
                    if (file.isValid()) {
254
                    if (file.isValid()) {
258
                        result.add (new LibrariesSourceGroup(roots[i],file.getNameExt(),icon, openedIcon));
255
                        result.add (new LibrariesSourceGroup(roots[i],file.getNameExt(),icon, openedIcon));
259
                    }
256
                    }
260
                } catch (FileStateInvalidException e) {
261
                    Exceptions.printStackTrace(e);
262
                }
263
            }
257
            }
264
            return result;
258
            return result;
265
        }
259
        }
(-)a/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/queries/GeneratedSourceRootTest.java (-10 / +10 lines)
 Lines 142-157    Link Here 
142
        FileObject src = d.getFileObject("src");
142
        FileObject src = d.getFileObject("src");
143
        FileObject test = d.getFileObject("test");
143
        FileObject test = d.getFileObject("test");
144
        FileObject stuff = d.getFileObject("build/generated-sources/stuff");
144
        FileObject stuff = d.getFileObject("build/generated-sources/stuff");
145
        URL classes = new URL(d.getURL(), "build/classes/");
145
        URL classes = new URL(d.toURL(), "build/classes/");
146
        URL testClasses = new URL(d.getURL(), "build/test/classes/");
146
        URL testClasses = new URL(d.toURL(), "build/test/classes/");
147
        FileObject xgen = stuff.getFileObject("net/nowhere/XGen.java");
147
        FileObject xgen = stuff.getFileObject("net/nowhere/XGen.java");
148
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
148
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
149
        assertEquals(Arrays.asList(test), Arrays.asList(SourceForBinaryQuery.findSourceRoots(testClasses).getRoots()));
149
        assertEquals(Arrays.asList(test), Arrays.asList(SourceForBinaryQuery.findSourceRoots(testClasses).getRoots()));
150
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(src.getURL()).getRoots()));
150
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(src.toURL()).getRoots()));
151
        assertEquals(Collections.singletonList(testClasses), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(test.getURL()).getRoots()));
151
        assertEquals(Collections.singletonList(testClasses), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(test.toURL()).getRoots()));
152
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(stuff.getURL()).getRoots()));
152
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(stuff.toURL()).getRoots()));
153
        assertEquals(Collections.singletonList(src.getURL()), Arrays.asList(UnitTestForSourceQuery.findSources(test)));
153
        assertEquals(Collections.singletonList(src.toURL()), Arrays.asList(UnitTestForSourceQuery.findSources(test)));
154
        assertEquals(Collections.singletonList(test.getURL()), Arrays.asList(UnitTestForSourceQuery.findUnitTests(src)));
154
        assertEquals(Collections.singletonList(test.toURL()), Arrays.asList(UnitTestForSourceQuery.findUnitTests(src)));
155
        assertEquals("1.5", SourceLevelQuery.getSourceLevel(stuff));
155
        assertEquals("1.5", SourceLevelQuery.getSourceLevel(stuff));
156
        FileBuiltQuery.Status status = FileBuiltQuery.getStatus(xgen);
156
        FileBuiltQuery.Status status = FileBuiltQuery.getStatus(xgen);
157
        assertNotNull(status);
157
        assertNotNull(status);
 Lines 164-170    Link Here 
164
        FileObject ygen = FileUtil.createData(moreStuff, "net/nowhere/YGen.java");
164
        FileObject ygen = FileUtil.createData(moreStuff, "net/nowhere/YGen.java");
165
        assertEquals(new HashSet<FileObject>(Arrays.asList(src, stuff, moreStuff)),
165
        assertEquals(new HashSet<FileObject>(Arrays.asList(src, stuff, moreStuff)),
166
                new HashSet<FileObject>(Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots())));
166
                new HashSet<FileObject>(Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots())));
167
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(moreStuff.getURL()).getRoots()));
167
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(moreStuff.toURL()).getRoots()));
168
        // XXX should previously created Result objects fire changes? ideally yes, but probably unnecessary
168
        // XXX should previously created Result objects fire changes? ideally yes, but probably unnecessary
169
        assertEquals("1.5", SourceLevelQuery.getSourceLevel(moreStuff));
169
        assertEquals("1.5", SourceLevelQuery.getSourceLevel(moreStuff));
170
        status = FileBuiltQuery.getStatus(ygen);
170
        status = FileBuiltQuery.getStatus(ygen);
 Lines 181-187    Link Here 
181
        Project p = createTestProject(false);
181
        Project p = createTestProject(false);
182
        FileObject d = p.getProjectDirectory();
182
        FileObject d = p.getProjectDirectory();
183
        FileObject src = d.getFileObject("src");
183
        FileObject src = d.getFileObject("src");
184
        URL classes = new URL(d.getURL(), "build/classes/");
184
        URL classes = new URL(d.toURL(), "build/classes/");
185
        ClassPath sourcePath = ClassPath.getClassPath(src, ClassPath.SOURCE);
185
        ClassPath sourcePath = ClassPath.getClassPath(src, ClassPath.SOURCE);
186
        assertEquals(Arrays.asList(src), Arrays.asList(sourcePath.getRoots()));
186
        assertEquals(Arrays.asList(src), Arrays.asList(sourcePath.getRoots()));
187
        assertEquals(Arrays.asList(src), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
187
        assertEquals(Arrays.asList(src), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
 Lines 191-197    Link Here 
191
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(sourcePath.getRoots()));
191
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(sourcePath.getRoots()));
192
        assertEquals(ClassPath.getClassPath(src, ClassPath.COMPILE), ClassPath.getClassPath(stuff, ClassPath.COMPILE));
192
        assertEquals(ClassPath.getClassPath(src, ClassPath.COMPILE), ClassPath.getClassPath(stuff, ClassPath.COMPILE));
193
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
193
        assertEquals(Arrays.asList(src, stuff), Arrays.asList(SourceForBinaryQuery.findSourceRoots(classes).getRoots()));
194
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(stuff.getURL()).getRoots()));
194
        assertEquals(Collections.singletonList(classes), Arrays.asList(BinaryForSourceQuery.findBinaryRoots(stuff.toURL()).getRoots()));
195
        FileBuiltQuery.Status status = FileBuiltQuery.getStatus(xgen);
195
        FileBuiltQuery.Status status = FileBuiltQuery.getStatus(xgen);
196
        assertNotNull(status);
196
        assertNotNull(status);
197
        assertFalse(status.isBuilt());
197
        assertFalse(status.isBuilt());
(-)a/java.api.common/test/unit/src/org/netbeans/modules/java/api/common/queries/JavadocForBinaryQueryImplTest.java (-4 / +3 lines)
 Lines 55-61    Link Here 
55
import org.netbeans.spi.project.support.ant.AntProjectHelper;
55
import org.netbeans.spi.project.support.ant.AntProjectHelper;
56
import org.netbeans.spi.project.support.ant.EditableProperties;
56
import org.netbeans.spi.project.support.ant.EditableProperties;
57
import org.netbeans.spi.project.support.ant.ProjectGenerator;
57
import org.netbeans.spi.project.support.ant.ProjectGenerator;
58
import org.openide.filesystems.FileStateInvalidException;
59
import org.openide.filesystems.FileUtil;
58
import org.openide.filesystems.FileUtil;
60
import org.openide.util.Mutex;
59
import org.openide.util.Mutex;
61
import org.openide.util.test.MockLookup;
60
import org.openide.util.test.MockLookup;
 Lines 107-113    Link Here 
107
                QuerySupport.createJavadocForBinaryQuery(helper, eval);
106
                QuerySupport.createJavadocForBinaryQuery(helper, eval);
108
107
109
        setProjectDirectory(JAVADOC_DIR, projdir.createFolder(JAVADOC_1));
108
        setProjectDirectory(JAVADOC_DIR, projdir.createFolder(JAVADOC_1));
110
        Result javadoc = javadocForBinaryQuery.findJavadoc(builddir.getURL());
109
        Result javadoc = javadocForBinaryQuery.findJavadoc(builddir.toURL());
111
        assertNotNull(javadoc);
110
        assertNotNull(javadoc);
112
111
113
        URL[] roots = javadoc.getRoots();
112
        URL[] roots = javadoc.getRoots();
 Lines 121-128    Link Here 
121
        assertEquals(getJavadocUrl(JAVADOC_2), roots[0]);
120
        assertEquals(getJavadocUrl(JAVADOC_2), roots[0]);
122
    }
121
    }
123
122
124
    private URL getJavadocUrl(String javadoc) throws FileStateInvalidException {
123
    private URL getJavadocUrl(String javadoc) {
125
        return projdir.getFileObject(javadoc).getURL();
124
        return projdir.getFileObject(javadoc).toURL();
126
    }
125
    }
127
126
128
    private void setProjectDirectory(final String property, final FileObject directory) throws Exception {
127
    private void setProjectDirectory(final String property, final FileObject directory) throws Exception {
(-)a/java.j2seproject/nbproject/project.xml (-1 / +1 lines)
 Lines 269-275    Link Here 
269
                    <build-prerequisite/>
269
                    <build-prerequisite/>
270
                    <compile-dependency/>
270
                    <compile-dependency/>
271
                    <run-dependency>
271
                    <run-dependency>
272
                        <specification-version>7.19</specification-version>
272
                        <specification-version>7.57</specification-version>
273
                    </run-dependency>
273
                    </run-dependency>
274
                </dependency>
274
                </dependency>
275
                <dependency>
275
                <dependency>
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/J2SESourcesTest.java (-3 / +3 lines)
 Lines 138-151    Link Here 
138
    }
138
    }
139
139
140
    public void testSourceRoots () throws Exception {        
140
    public void testSourceRoots () throws Exception {        
141
        FileObject[] roots = SourceForBinaryQuery.findSourceRoots(classes.getURL()).getRoots();
141
        FileObject[] roots = SourceForBinaryQuery.findSourceRoots(classes.toURL()).getRoots();
142
        assertNotNull (roots);        
142
        assertNotNull (roots);        
143
        assertEquals("There should be 1 src root",1,roots.length);
143
        assertEquals("There should be 1 src root",1,roots.length);
144
        assertTrue ("The source root is not valid", sources.isValid());
144
        assertTrue ("The source root is not valid", sources.isValid());
145
        assertEquals("Invalid src root", sources, roots[0]);               
145
        assertEquals("Invalid src root", sources, roots[0]);               
146
        FileObject src2 = projdir.createFolder("src2");        
146
        FileObject src2 = projdir.createFolder("src2");        
147
        addSourceRoot (helper, src2, "src2");        
147
        addSourceRoot (helper, src2, "src2");        
148
        roots = SourceForBinaryQuery.findSourceRoots(classes.getURL()).getRoots();
148
        roots = SourceForBinaryQuery.findSourceRoots(classes.toURL()).getRoots();
149
        assertNotNull (roots);
149
        assertNotNull (roots);
150
        assertEquals("There should be 2 src roots", 2, roots.length);
150
        assertEquals("There should be 2 src roots", 2, roots.length);
151
        assertTrue ("The source root is not valid", sources.isValid());
151
        assertTrue ("The source root is not valid", sources.isValid());
 Lines 199-205    Link Here 
199
        //test: adding of src root should fire once
199
        //test: adding of src root should fire once
200
        URL[] newRootUrls = new URL[oldRootUrls.length+1];
200
        URL[] newRootUrls = new URL[oldRootUrls.length+1];
201
        System.arraycopy(oldRootUrls, 0, newRootUrls, 0, oldRootUrls.length);
201
        System.arraycopy(oldRootUrls, 0, newRootUrls, 0, oldRootUrls.length);
202
        newRootUrls[newRootUrls.length-1] = newRoot.getURL();
202
        newRootUrls[newRootUrls.length-1] = newRoot.toURL();
203
        String[] newRootLabels = new String[oldRootLabels.length+1];
203
        String[] newRootLabels = new String[oldRootLabels.length+1];
204
        for (int i=0; i< oldRootLabels.length; i++) {
204
        for (int i=0; i< oldRootLabels.length; i++) {
205
            newRootLabels[i] = roots.getRootDisplayName(oldRootLabels[i], oldRootProps[i]);
205
            newRootLabels[i] = roots.getRootDisplayName(oldRootLabels[i], oldRootProps[i]);
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/SourceRootsTest.java (-6 / +6 lines)
 Lines 125-131    Link Here 
125
        URL[] srcURLs = srcs.getRootURLs();
125
        URL[] srcURLs = srcs.getRootURLs();
126
        assertNotNull ("Root URLs can not be null",srcURLs);
126
        assertNotNull ("Root URLs can not be null",srcURLs);
127
        assertEquals ("Root URLs length must be 1",1,srcURLs.length);
127
        assertEquals ("Root URLs length must be 1",1,srcURLs.length);
128
        assertEquals("Root URLs should be "+this.sources.getURL(),this.sources.getURL(),srcURLs[0]);
128
        assertEquals("Root URLs should be "+this.sources.toURL(),this.sources.toURL(),srcURLs[0]);
129
        SourceRoots tsts = pp.getTestSourceRoots();
129
        SourceRoots tsts = pp.getTestSourceRoots();
130
        srcProps = tsts.getRootProperties();
130
        srcProps = tsts.getRootProperties();
131
        assertNotNull ("Source properties can not be null",srcProps);
131
        assertNotNull ("Source properties can not be null",srcProps);
 Lines 138-144    Link Here 
138
        srcURLs = tsts.getRootURLs();
138
        srcURLs = tsts.getRootURLs();
139
        assertNotNull ("Root URLs can not be null",srcURLs);
139
        assertNotNull ("Root URLs can not be null",srcURLs);
140
        assertEquals ("Root URLs length must be 1",1,srcURLs.length);
140
        assertEquals ("Root URLs length must be 1",1,srcURLs.length);
141
        assertEquals("Root URLs should be "+this.tests.getURL(),this.tests.getURL(),srcURLs[0]);
141
        assertEquals("Root URLs should be "+this.tests.toURL(),this.tests.toURL(),srcURLs[0]);
142
        //Now add new source root
142
        //Now add new source root
143
        TestListener tl = new TestListener();
143
        TestListener tl = new TestListener();
144
        srcs.addPropertyChangeListener (tl);
144
        srcs.addPropertyChangeListener (tl);
 Lines 156-163    Link Here 
156
        srcURLs = srcs.getRootURLs();
156
        srcURLs = srcs.getRootURLs();
157
        assertNotNull ("Root URLs can not be null",srcURLs);
157
        assertNotNull ("Root URLs can not be null",srcURLs);
158
        assertEquals ("Root URLs length must be 2",2,srcURLs.length);
158
        assertEquals ("Root URLs length must be 2",2,srcURLs.length);
159
        assertEquals("The first root URLs should be "+this.sources.getURL(),this.sources.getURL(),srcURLs[0]);
159
        assertEquals("The first root URLs should be "+this.sources.toURL(),this.sources.toURL(),srcURLs[0]);
160
        assertEquals("The second root URLs should be "+newRoot.getURL(),newRoot.getURL(),srcURLs[1]);
160
        assertEquals("The second root URLs should be "+newRoot.toURL(),newRoot.toURL(),srcURLs[1]);
161
        Set events = tl.getEvents();
161
        Set events = tl.getEvents();
162
        assertTrue ("PROP_ROOT_PROPERTIES has to be fired",events.contains(SourceRoots.PROP_ROOT_PROPERTIES));
162
        assertTrue ("PROP_ROOT_PROPERTIES has to be fired",events.contains(SourceRoots.PROP_ROOT_PROPERTIES));
163
        assertTrue ("PROP_ROOTS has to be fired",events.contains(SourceRoots.PROP_ROOTS));
163
        assertTrue ("PROP_ROOTS has to be fired",events.contains(SourceRoots.PROP_ROOTS));
 Lines 176-183    Link Here 
176
        srcURLs = srcs.getRootURLs();
176
        srcURLs = srcs.getRootURLs();
177
        assertNotNull ("Root URLs can not be null",srcURLs);
177
        assertNotNull ("Root URLs can not be null",srcURLs);
178
        assertEquals ("Root URLs length must be 2",2,srcURLs.length);
178
        assertEquals ("Root URLs length must be 2",2,srcURLs.length);
179
        assertEquals("The first root URLs should be "+this.sources.getURL(),this.sources.getURL(),srcURLs[0]);
179
        assertEquals("The first root URLs should be "+this.sources.toURL(),this.sources.toURL(),srcURLs[0]);
180
        assertEquals("The second root URLs should be "+newRoot.getURL(),newRoot.getURL(),srcURLs[1]);
180
        assertEquals("The second root URLs should be "+newRoot.toURL(),newRoot.toURL(),srcURLs[1]);
181
        events = tl.getEvents();
181
        events = tl.getEvents();
182
        assertEquals(Collections.singleton(SourceRoots.PROP_ROOTS), events);
182
        assertEquals(Collections.singleton(SourceRoots.PROP_ROOTS), events);
183
        srcs.removePropertyChangeListener(tl);
183
        srcs.removePropertyChangeListener(tl);
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/classpath/BootClassPathImplementationTest.java (-2 / +2 lines)
 Lines 92-99    Link Here 
92
        scratch = TestUtil.makeScratchDir(this);
92
        scratch = TestUtil.makeScratchDir(this);
93
        this.defaultPlatformBootRoot = scratch.createFolder("DefaultPlatformBootRoot");
93
        this.defaultPlatformBootRoot = scratch.createFolder("DefaultPlatformBootRoot");
94
        this.explicitPlatformBootRoot = scratch.createFolder("ExplicitPlatformBootRoot");
94
        this.explicitPlatformBootRoot = scratch.createFolder("ExplicitPlatformBootRoot");
95
        ClassPath defBCP = ClassPathSupport.createClassPath(new URL[]{defaultPlatformBootRoot.getURL()});
95
        ClassPath defBCP = ClassPathSupport.createClassPath(new URL[]{defaultPlatformBootRoot.toURL()});
96
        ClassPath expBCP = ClassPathSupport.createClassPath(new URL[]{explicitPlatformBootRoot.getURL()});
96
        ClassPath expBCP = ClassPathSupport.createClassPath(new URL[]{explicitPlatformBootRoot.toURL()});
97
        tp = new TestPlatformProvider (defBCP, expBCP);
97
        tp = new TestPlatformProvider (defBCP, expBCP);
98
        MockLookup.setLayersAndInstances(
98
        MockLookup.setLayersAndInstances(
99
            new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation(),
99
            new org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation(),
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/classpath/J2SEProjectClassPathModifierTest.java (-8 / +8 lines)
 Lines 117-136    Link Here 
117
        final FileObject rootFolder = this.scratch.createFolder("Root");
117
        final FileObject rootFolder = this.scratch.createFolder("Root");
118
        final FileObject jarFile = TestFileUtils.writeZipFile(scratch, "archive.jar", "Test.properties:");
118
        final FileObject jarFile = TestFileUtils.writeZipFile(scratch, "archive.jar", "Test.properties:");
119
        final FileObject jarRoot = FileUtil.getArchiveRoot(jarFile);
119
        final FileObject jarRoot = FileUtil.getArchiveRoot(jarFile);
120
        ProjectClassPathModifier.addRoots (new URL[] {rootFolder.getURL()}, this.src, ClassPath.COMPILE);
120
        ProjectClassPathModifier.addRoots (new URL[] {rootFolder.toURL()}, this.src, ClassPath.COMPILE);
121
        String cp = this.eval.getProperty("javac.classpath");
121
        String cp = this.eval.getProperty("javac.classpath");
122
        assertNotNull (cp);
122
        assertNotNull (cp);
123
        String[] cpRoots = PropertyUtils.tokenizePath (cp);
123
        String[] cpRoots = PropertyUtils.tokenizePath (cp);
124
        assertNotNull (cpRoots);
124
        assertNotNull (cpRoots);
125
        assertEquals(1,cpRoots.length);
125
        assertEquals(1,cpRoots.length);
126
        assertEquals(rootFolder,this.helper.resolveFileObject(cpRoots[0]));
126
        assertEquals(rootFolder,this.helper.resolveFileObject(cpRoots[0]));
127
        ProjectClassPathModifier.removeRoots (new URL[] {rootFolder.getURL()},this.src, ClassPath.COMPILE);
127
        ProjectClassPathModifier.removeRoots (new URL[] {rootFolder.toURL()},this.src, ClassPath.COMPILE);
128
        cp = this.eval.getProperty("javac.classpath");
128
        cp = this.eval.getProperty("javac.classpath");
129
        assertNotNull (cp);
129
        assertNotNull (cp);
130
        cpRoots = PropertyUtils.tokenizePath (cp);
130
        cpRoots = PropertyUtils.tokenizePath (cp);
131
        assertNotNull (cpRoots);
131
        assertNotNull (cpRoots);
132
        assertEquals(0,cpRoots.length);
132
        assertEquals(0,cpRoots.length);
133
        ProjectClassPathModifier.addRoots(new URL[] {jarRoot.getURL()},this.test,ClassPath.EXECUTE);
133
        ProjectClassPathModifier.addRoots(new URL[] {jarRoot.toURL()},this.test,ClassPath.EXECUTE);
134
        cp = this.eval.getProperty("run.test.classpath");
134
        cp = this.eval.getProperty("run.test.classpath");
135
        assertNotNull (cp);
135
        assertNotNull (cp);
136
        cpRoots = PropertyUtils.tokenizePath (cp);
136
        cpRoots = PropertyUtils.tokenizePath (cp);
 Lines 162-168    Link Here 
162
        String[] cpRoots = PropertyUtils.tokenizePath (cp);
162
        String[] cpRoots = PropertyUtils.tokenizePath (cp);
163
        assertNotNull (cpRoots);
163
        assertNotNull (cpRoots);
164
        assertEquals(1,cpRoots.length);
164
        assertEquals(1,cpRoots.length);
165
        URI projectURI = URI.create(output.getProject().getProjectDirectory().getURL().toExternalForm());
165
        URI projectURI = URI.create(output.getProject().getProjectDirectory().toURL().toExternalForm());
166
        URI expected = projectURI.resolve(output.getArtifactLocations()[0]);
166
        URI expected = projectURI.resolve(output.getArtifactLocations()[0]);
167
        assertEquals(expected,this.helper.resolveFile(cpRoots[0]).toURI());
167
        assertEquals(expected,this.helper.resolveFile(cpRoots[0]).toURI());
168
        ProjectClassPathModifier.removeAntArtifacts(new AntArtifact[] {output}, new URI[] {output.getArtifactLocations()[0]},this.src, ClassPath.COMPILE);
168
        ProjectClassPathModifier.removeAntArtifacts(new AntArtifact[] {output}, new URI[] {output.getArtifactLocations()[0]},this.src, ClassPath.COMPILE);
 Lines 180-186    Link Here 
180
        assertNotNull (impls);
180
        assertNotNull (impls);
181
        assertEquals(1,impls.length);
181
        assertEquals(1,impls.length);
182
        FileObject libRoot = this.scratch.createFolder("libRoot");
182
        FileObject libRoot = this.scratch.createFolder("libRoot");
183
        impls[0].setContent("classpath",Collections.singletonList(libRoot.getURL()));
183
        impls[0].setContent("classpath",Collections.singletonList(libRoot.toURL()));
184
        Library[] libs =LibraryManager.getDefault().getLibraries();
184
        Library[] libs =LibraryManager.getDefault().getLibraries();
185
        assertNotNull (libs);
185
        assertNotNull (libs);
186
        assertEquals(1,libs.length);
186
        assertEquals(1,libs.length);
 Lines 248-254    Link Here 
248
        final File jar = FileUtil.toFile(jarFile);
248
        final File jar = FileUtil.toFile(jarFile);
249
        assertNotNull(jar);
249
        assertNotNull(jar);
250
        final FileObject jarRoot = FileUtil.getArchiveRoot(jarFile);
250
        final FileObject jarRoot = FileUtil.getArchiveRoot(jarFile);
251
        final URL rootFolderURL = rootFolder.getURL();
251
        final URL rootFolderURL = rootFolder.toURL();
252
        ProjectClassPathModifier.addRoots (new URL[] {rootFolderURL}, this.src, ClassPath.COMPILE);
252
        ProjectClassPathModifier.addRoots (new URL[] {rootFolderURL}, this.src, ClassPath.COMPILE);
253
        String cp = this.eval.getProperty("javac.classpath");
253
        String cp = this.eval.getProperty("javac.classpath");
254
        assertNotNull (cp);
254
        assertNotNull (cp);
 Lines 264-270    Link Here 
264
        cpRoots = PropertyUtils.tokenizePath (cp);
264
        cpRoots = PropertyUtils.tokenizePath (cp);
265
        assertNotNull (cpRoots);
265
        assertNotNull (cpRoots);
266
        assertEquals(0,cpRoots.length);
266
        assertEquals(0,cpRoots.length);
267
        final URL jarRootURL = jarRoot.getURL();
267
        final URL jarRootURL = jarRoot.toURL();
268
        ProjectClassPathModifier.addRoots(new URL[] {jarRootURL},this.test,ClassPath.EXECUTE);
268
        ProjectClassPathModifier.addRoots(new URL[] {jarRootURL},this.test,ClassPath.EXECUTE);
269
        cp = this.eval.getProperty("run.test.classpath");
269
        cp = this.eval.getProperty("run.test.classpath");
270
        assertNotNull (cp);
270
        assertNotNull (cp);
 Lines 303-309    Link Here 
303
        final ClassPath cp = ClassPath.getClassPath(srcGrp.getRootFolder(), JavaClassPathConstants.PROCESSOR_PATH);
303
        final ClassPath cp = ClassPath.getClassPath(srcGrp.getRootFolder(), JavaClassPathConstants.PROCESSOR_PATH);
304
        assertFalse(Arrays.asList(cp.getRoots()).contains(libRoot));
304
        assertFalse(Arrays.asList(cp.getRoots()).contains(libRoot));
305
        ProjectClassPathModifier.addRoots(
305
        ProjectClassPathModifier.addRoots(
306
            new URI[] {libRoot.getURL().toURI()},
306
            new URI[] {libRoot.toURI()},
307
            srcGrp.getRootFolder(),
307
            srcGrp.getRootFolder(),
308
            JavaClassPathConstants.PROCESSOR_PATH);
308
            JavaClassPathConstants.PROCESSOR_PATH);
309
        assertTrue("No lib on processor path!", Arrays.asList(cp.getRoots()).contains(libRoot));    //NOI18N
309
        assertTrue("No lib on processor path!", Arrays.asList(cp.getRoots()).contains(libRoot));    //NOI18N
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/queries/BinaryForSourceQueryImplTest.java (-5 / +5 lines)
 Lines 105-119    Link Here 
105
    public void testBinaryForSourceQuery() throws Exception {
105
    public void testBinaryForSourceQuery() throws Exception {
106
        this.prepareProject();
106
        this.prepareProject();
107
        FileObject folder = scratch.createFolder("SomeFolder");
107
        FileObject folder = scratch.createFolder("SomeFolder");
108
        BinaryForSourceQuery.Result result = BinaryForSourceQuery.findBinaryRoots(folder.getURL());
108
        BinaryForSourceQuery.Result result = BinaryForSourceQuery.findBinaryRoots(folder.toURL());
109
        assertEquals("Non-project folder does not have any source folder", 0, result.getRoots().length);
109
        assertEquals("Non-project folder does not have any source folder", 0, result.getRoots().length);
110
        folder = projdir.createFolder("SomeFolderInProject");
110
        folder = projdir.createFolder("SomeFolderInProject");
111
        result = BinaryForSourceQuery.findBinaryRoots(folder.getURL());
111
        result = BinaryForSourceQuery.findBinaryRoots(folder.toURL());
112
        assertEquals("Project non build folder does not have any source folder", 0, result.getRoots().length);
112
        assertEquals("Project non build folder does not have any source folder", 0, result.getRoots().length);
113
        result = BinaryForSourceQuery.findBinaryRoots(sources.getURL());        
113
        result = BinaryForSourceQuery.findBinaryRoots(sources.toURL());
114
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
114
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
115
        assertEquals("Project build folder must have source folder",buildClasses.getURL(),result.getRoots()[0]);        
115
        assertEquals("Project build folder must have source folder",buildClasses.toURL(),result.getRoots()[0]);
116
        BinaryForSourceQuery.Result result2 = BinaryForSourceQuery.findBinaryRoots(sources.getURL());
116
        BinaryForSourceQuery.Result result2 = BinaryForSourceQuery.findBinaryRoots(sources.toURL());
117
        assertTrue (result == result2);
117
        assertTrue (result == result2);
118
    }               
118
    }               
119
                    
119
                    
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/queries/CompiledSourceForBinaryQueryTest.java (-5 / +5 lines)
 Lines 116-127    Link Here 
116
    public void testSourceForBinaryQuery() throws Exception {
116
    public void testSourceForBinaryQuery() throws Exception {
117
        this.prepareProject();
117
        this.prepareProject();
118
        FileObject folder = scratch.createFolder("SomeFolder");
118
        FileObject folder = scratch.createFolder("SomeFolder");
119
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(folder.getURL());
119
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(folder.toURL());
120
        assertEquals("Non-project folder does not have any source folder", 0, result.getRoots().length);
120
        assertEquals("Non-project folder does not have any source folder", 0, result.getRoots().length);
121
        folder = projdir.createFolder("SomeFolderInProject");
121
        folder = projdir.createFolder("SomeFolderInProject");
122
        result = SourceForBinaryQuery.findSourceRoots(folder.getURL());
122
        result = SourceForBinaryQuery.findSourceRoots(folder.toURL());
123
        assertEquals("Project non build folder does not have any source folder", 0, result.getRoots().length);
123
        assertEquals("Project non build folder does not have any source folder", 0, result.getRoots().length);
124
        result = SourceForBinaryQuery.findSourceRoots(buildClasses.getURL());
124
        result = SourceForBinaryQuery.findSourceRoots(buildClasses.toURL());
125
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
125
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
126
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
126
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
127
    }               
127
    }               
 Lines 129-135    Link Here 
129
    
129
    
130
    public void testSourceForBinaryQueryListening () throws Exception {
130
    public void testSourceForBinaryQueryListening () throws Exception {
131
        this.prepareProject();
131
        this.prepareProject();
132
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(buildClasses.getURL());
132
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(buildClasses.toURL());
133
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
133
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
134
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
134
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
135
        TestListener tl = new TestListener ();
135
        TestListener tl = new TestListener ();
 Lines 145-151    Link Here 
145
145
146
    public void testSourceForBinaryQueryMultipleSourceRoots () throws Exception {
146
    public void testSourceForBinaryQueryMultipleSourceRoots () throws Exception {
147
        this.prepareProject();
147
        this.prepareProject();
148
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(buildClasses.getURL());
148
        SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(buildClasses.toURL());
149
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
149
        assertEquals("Project build folder must have source folder", 1, result.getRoots().length);
150
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
150
        assertEquals("Project build folder must have source folder",sources,result.getRoots()[0]);
151
        TestListener tl = new TestListener ();
151
        TestListener tl = new TestListener ();
(-)a/java.j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/queries/UnitTestForSourceQueryImplTest.java (-3 / +3 lines)
 Lines 122-128    Link Here 
122
        assertEquals(result, u);
122
        assertEquals(result, u);
123
        
123
        
124
        //Test the case when the tests folder does not exist
124
        //Test the case when the tests folder does not exist
125
        result = tests.getURL();
125
        result = tests.toURL();
126
        tests.delete();
126
        tests.delete();
127
        u = UnitTestForSourceQuery.findUnitTest (sources);
127
        u = UnitTestForSourceQuery.findUnitTest (sources);
128
        assertEquals (result, u);
128
        assertEquals (result, u);
 Lines 133-140    Link Here 
133
        URL[] urls = UnitTestForSourceQuery.findSources(tests);
133
        URL[] urls = UnitTestForSourceQuery.findSources(tests);
134
        assertNotNull(urls);
134
        assertNotNull(urls);
135
        assertEquals(2,urls.length);
135
        assertEquals(2,urls.length);
136
        assertEquals(sources.getURL(), urls[0]);
136
        assertEquals(sources.toURL(), urls[0]);
137
        assertEquals(newRoot.getURL(), urls[1]);
137
        assertEquals(newRoot.toURL(), urls[1]);
138
    }
138
    }
139
139
140
}
140
}
(-)a/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateLayerConsistencyTest.java (-1 / +1 lines)
 Lines 946-952    Link Here 
946
        FileObject libs = FileUtil.getConfigFile("org-netbeans-api-project-libraries/Libraries");
946
        FileObject libs = FileUtil.getConfigFile("org-netbeans-api-project-libraries/Libraries");
947
        if (libs != null) {
947
        if (libs != null) {
948
            for (FileObject lib : libs.getChildren()) {
948
            for (FileObject lib : libs.getChildren()) {
949
                Document doc = XMLUtil.parse(new InputSource(lib.getURL().toString()), true, false, XMLUtil.defaultErrorHandler(), EntityCatalog.getDefault());
949
                Document doc = XMLUtil.parse(new InputSource(lib.toURL().toString()), true, false, XMLUtil.defaultErrorHandler(), EntityCatalog.getDefault());
950
                NodeList nl = doc.getElementsByTagName("resource");
950
                NodeList nl = doc.getElementsByTagName("resource");
951
                for (int i = 0; i < nl.getLength(); i++) {
951
                for (int i = 0; i < nl.getLength(); i++) {
952
                    Element resource = (Element) nl.item(i);
952
                    Element resource = (Element) nl.item(i);
(-)a/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateModulesTest.java (-1 / +1 lines)
 Lines 175-181    Link Here 
175
    public void testAutomaticDependenciesUnused() throws Exception {
175
    public void testAutomaticDependenciesUnused() throws Exception {
176
        List<URL> urls = new ArrayList<URL>();
176
        List<URL> urls = new ArrayList<URL>();
177
        for (FileObject kid : FileUtil.getConfigFile("ModuleAutoDeps").getChildren()) {
177
        for (FileObject kid : FileUtil.getConfigFile("ModuleAutoDeps").getChildren()) {
178
            urls.add(kid.getURL());
178
            urls.add(kid.toURL());
179
        }
179
        }
180
        StringBuilder problems = new StringBuilder();
180
        StringBuilder problems = new StringBuilder();
181
        AutomaticDependencies ad = AutomaticDependencies.parse(urls.toArray(new URL[urls.size()]));
181
        AutomaticDependencies ad = AutomaticDependencies.parse(urls.toArray(new URL[urls.size()]));
(-)a/openide.execution/apichanges.xml (+20 lines)
 Lines 57-62    Link Here 
57
    <!-- ACTUAL CHANGES BEGIN HERE: -->
57
    <!-- ACTUAL CHANGES BEGIN HERE: -->
58
58
59
    <changes>
59
    <changes>
60
        <change id="NbClassLoader.no.FileStateInvalidException">
61
            <api name="execution"/>
62
            <summary><code>NbClassLoader(FileObject[], ...)</code> does not throw <code>FileStateInvalidException</code></summary>
63
            <version major="1" minor="26"/>
64
            <date year="2012" month="1" day="20"/>
65
            <author login="jglick"/>
66
            <compatibility source="incompatible">
67
                <p>
68
                    No <code>NbClassLoader</code> constructor throws <code>FileStateInvalidException</code> any longer,
69
                    which can cause some existing source code to not compile.
70
                </p>
71
            </compatibility>
72
            <description>
73
                <p>
74
                    <code>NbClassLoader(FileObject[], ClassLoader, InputOutput)</code> does not throw <code>FileStateInvalidException</code> any more.
75
                </p>
76
            </description>
77
            <class package="org.openide.execution" name="NbClassLoader"/>
78
            <issue number="207294"/>
79
        </change>
60
    <change id="automatic-request-of-engine-impl">
80
    <change id="automatic-request-of-engine-impl">
61
      <api name="execution"/>
81
      <api name="execution"/>
62
      <summary> No need to require ExecutionEngine token anymore</summary>
82
      <summary> No need to require ExecutionEngine token anymore</summary>
(-)a/openide.execution/manifest.mf (-1 / +1 lines)
 Lines 1-6    Link Here 
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.execution
2
OpenIDE-Module: org.openide.execution
3
OpenIDE-Module-Specification-Version: 1.25
3
OpenIDE-Module-Specification-Version: 1.26
4
OpenIDE-Module-Localizing-Bundle: org/openide/execution/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/execution/Bundle.properties
5
OpenIDE-Module-Recommends: org.openide.execution.ExecutionEngine
5
OpenIDE-Module-Recommends: org.openide.execution.ExecutionEngine
6
AutoUpdate-Essential-Module: true
6
AutoUpdate-Essential-Module: true
(-)a/openide.execution/nbproject/project.xml (-9 / +9 lines)
 Lines 54-60    Link Here 
54
                    <build-prerequisite/>
54
                    <build-prerequisite/>
55
                    <compile-dependency/>
55
                    <compile-dependency/>
56
                    <run-dependency>
56
                    <run-dependency>
57
                        <specification-version>6.2</specification-version>
57
                        <specification-version>7.57</specification-version>
58
                    </run-dependency>
59
                </dependency>
60
                <dependency>
61
                    <code-name-base>org.openide.io</code-name-base>
62
                    <build-prerequisite/>
63
                    <compile-dependency/>
64
                    <run-dependency>
65
                        <specification-version>1.0</specification-version>
58
                    </run-dependency>
66
                    </run-dependency>
59
                </dependency>
67
                </dependency>
60
                <dependency>
68
                <dependency>
 Lines 73-86    Link Here 
73
                        <specification-version>8.0</specification-version>
81
                        <specification-version>8.0</specification-version>
74
                    </run-dependency>
82
                    </run-dependency>
75
                </dependency>
83
                </dependency>
76
                <dependency>
77
                    <code-name-base>org.openide.io</code-name-base>
78
                    <build-prerequisite/>
79
                    <compile-dependency/>
80
                    <run-dependency>
81
                        <specification-version>1.0</specification-version>
82
                    </run-dependency>
83
                </dependency>
84
            </module-dependencies>
84
            </module-dependencies>
85
            <test-dependencies>
85
            <test-dependencies>
86
                <test-type>
86
                <test-type>
(-)a/openide.execution/src/org/openide/execution/NbClassLoader.java (-6 / +4 lines)
 Lines 54-66    Link Here 
54
import java.security.PermissionCollection;
54
import java.security.PermissionCollection;
55
import java.util.Enumeration;
55
import java.util.Enumeration;
56
import java.util.HashMap;
56
import java.util.HashMap;
57
import java.util.concurrent.atomic.AtomicBoolean;
58
import java.util.jar.Manifest;
57
import java.util.jar.Manifest;
59
import java.util.logging.Level;
58
import java.util.logging.Level;
60
import java.util.logging.Logger;
59
import java.util.logging.Logger;
61
import org.openide.filesystems.FileObject;
60
import org.openide.filesystems.FileObject;
62
import org.openide.filesystems.FileStateInvalidException;
63
import org.openide.filesystems.FileSystem;
61
import org.openide.filesystems.FileSystem;
62
import org.openide.filesystems.FileSystemCapability;
64
import org.openide.filesystems.FileUtil;
63
import org.openide.filesystems.FileUtil;
65
import org.openide.filesystems.URLMapper;
64
import org.openide.filesystems.URLMapper;
66
import org.openide.util.Exceptions;
65
import org.openide.util.Exceptions;
 Lines 115-125    Link Here 
115
     * @param roots a set of package roots
114
     * @param roots a set of package roots
116
     * @param parent a parent loader
115
     * @param parent a parent loader
117
     * @param io an I/O tab in the Output Window, or null
116
     * @param io an I/O tab in the Output Window, or null
118
     * @throws FileStateInvalidException if some of the roots are not valid
119
     * @since XXX
117
     * @since XXX
120
     */
118
     */
121
    static ThreadLocal<Boolean> f = new ThreadLocal<Boolean>();
119
    static ThreadLocal<Boolean> f = new ThreadLocal<Boolean>();
122
    public NbClassLoader(FileObject[] roots, ClassLoader parent, InputOutput io) throws FileStateInvalidException {
120
    public NbClassLoader(FileObject[] roots, ClassLoader parent, InputOutput io) {
123
        super(createRootURLs(roots), parent);
121
        super(createRootURLs(roots), parent);
124
        fast = canOptimize(getURLs());
122
        fast = canOptimize(getURLs());
125
        inout = io;
123
        inout = io;
 Lines 286-295    Link Here 
286
     * @param roots file roots
284
     * @param roots file roots
287
     * @return array of URLs
285
     * @return array of URLs
288
     */
286
     */
289
    private static URL[] createRootURLs(FileObject[] roots) throws FileStateInvalidException {
287
    private static URL[] createRootURLs(FileObject[] roots) {
290
        URL[] urls = new URL[roots.length];
288
        URL[] urls = new URL[roots.length];
291
        for (int i = 0; i < roots.length; i++) {
289
        for (int i = 0; i < roots.length; i++) {
292
            urls[i] = roots[i].getURL();
290
            urls[i] = roots[i].toURL();
293
            }
291
            }
294
        return urls;
292
        return urls;
295
    }
293
    }
(-)a/openide.filesystems/apichanges.xml (+26 lines)
 Lines 49-54    Link Here 
49
        <apidef name="filesystems">Filesystems API</apidef>
49
        <apidef name="filesystems">Filesystems API</apidef>
50
    </apidefs>
50
    </apidefs>
51
    <changes>
51
    <changes>
52
        <change id="FileObject.toURI">
53
            <api name="filesystems"/>
54
            <summary>Introduced <code>FileObject.toURI</code></summary>
55
            <version major="7" minor="57"/>
56
            <date year="2012" month="1" day="20"/>
57
            <author login="jglick"/>
58
            <compatibility addition="yes" deprecation="yes">
59
                <p>
60
                    <code>FileObject.getURL</code> should be replaced with <code>toURL</code> (or <code>toURI</code>),
61
                    which also throw no checked exceptions.
62
                </p>
63
            </compatibility>
64
            <description>
65
                <p>
66
                    Added <code>FileObject.toURI</code> for convenience.
67
                </p>
68
                <p>
69
                    Also deprecated <code>FileObject.getURL</code> in favor of <code>toURL</code>
70
                    which is the same but does not throw <code>FileStateInvalidException</code>,
71
                    and clarified that <code>URLMapper.findURL(fo, INTERNAL)</code>
72
                    will never return null.
73
                </p>
74
            </description>
75
            <class package="org.openide.filesystems" name="FileObject"/>
76
            <issue number="207294"/>
77
        </change>
52
         <change id="default-line-separator">
78
         <change id="default-line-separator">
53
            <api name="filesystems"/>
79
            <api name="filesystems"/>
54
            <summary>Provides default line separator</summary>
80
            <summary>Provides default line separator</summary>
(-)a/openide.filesystems/manifest.mf (-1 / +1 lines)
 Lines 2-6    Link Here 
2
OpenIDE-Module: org.openide.filesystems
2
OpenIDE-Module: org.openide.filesystems
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/filesystems/Bundle.properties
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
4
OpenIDE-Module-Layer: org/openide/filesystems/resources/layer.xml
5
OpenIDE-Module-Specification-Version: 7.56
5
OpenIDE-Module-Specification-Version: 7.57
6
6
(-)a/openide.filesystems/src/META-INF/upgrade/FileObject.hint (+30 lines)
 Lines 2-4    Link Here 
2
=>
2
=>
3
!$f.canWrite()
3
!$f.canWrite()
4
;;
4
;;
5
6
$f.getURL().toURI() :: $f instanceof org.openide.filesystems.FileObject
7
=>
8
$f.toURI()
9
;;
10
11
java.net.URI.create($f.getURL().toString()) :: $f instanceof org.openide.filesystems.FileObject
12
=>
13
$f.toURI()
14
;;
15
16
new java.net.URI($f.getURL().toString()) :: $f instanceof org.openide.filesystems.FileObject
17
=>
18
$f.toURI()
19
;;
20
21
java.net.URI.create($f.getURL().toExternalForm()) :: $f instanceof org.openide.filesystems.FileObject
22
=>
23
$f.toURI()
24
;;
25
26
new java.net.URI($f.getURL().toExternalForm()) :: $f instanceof org.openide.filesystems.FileObject
27
=>
28
$f.toURI()
29
;;
30
31
$f.getURL() :: $f instanceof org.openide.filesystems.FileObject
32
=>
33
$f.toURL()
34
;;
(-)a/openide.filesystems/src/org/netbeans/modules/openide/filesystems/declmime/DefaultParser.java (-1 / +1 lines)
 Lines 133-139    Link Here 
133
            InputSource in = new InputSource();                
133
            InputSource in = new InputSource();                
134
            is = fo.getInputStream();
134
            is = fo.getInputStream();
135
            in.setByteStream(is);
135
            in.setByteStream(is);
136
            in.setSystemId(fo.getURL().toExternalForm());
136
            in.setSystemId(fo.toURL().toExternalForm());
137
            customizeInputSource(in);
137
            customizeInputSource(in);
138
            
138
            
139
            parser.parse(in);
139
            parser.parse(in);
(-)a/openide.filesystems/src/org/openide/filesystems/AbstractFolder.java (-1 / +1 lines)
 Lines 1022-1028    Link Here 
1022
        throws IOException {
1022
        throws IOException {
1023
            fsname = f.getFileSystem().getSystemName();
1023
            fsname = f.getFileSystem().getSystemName();
1024
            path = f.getPath();
1024
            path = f.getPath();
1025
            url = f.getURL();
1025
            url = f.toURL();
1026
            assert url != null : "No URL for " + path;
1026
            assert url != null : "No URL for " + path;
1027
            oos.defaultWriteObject();
1027
            oos.defaultWriteObject();
1028
        }
1028
        }
(-)a/openide.filesystems/src/org/openide/filesystems/FileObject.java (-3 / +30 lines)
 Lines 51-56    Link Here 
51
import java.io.InputStream;
51
import java.io.InputStream;
52
import java.io.OutputStream;
52
import java.io.OutputStream;
53
import java.io.Serializable;
53
import java.io.Serializable;
54
import java.net.URI;
55
import java.net.URISyntaxException;
54
import java.net.URL;
56
import java.net.URL;
55
import java.nio.charset.Charset;
57
import java.nio.charset.Charset;
56
import java.util.Arrays;
58
import java.util.Arrays;
 Lines 1128-1148    Link Here 
1128
        refresh(false);
1130
        refresh(false);
1129
    }
1131
    }
1130
1132
1133
    /**
1134
     * @throws FileStateInvalidException never
1135
     * @deprecated Use {@link #toURL} instead.
1136
     */
1137
    @Deprecated
1138
    public final URL getURL() throws FileStateInvalidException {
1139
        return toURL();
1140
    }
1141
1131
    /** Get URL that can be used to access this file.
1142
    /** Get URL that can be used to access this file.
1132
     * If the file object does not correspond to a disk file or JAR entry,
1143
     * If the file object does not correspond to a disk file or JAR entry,
1133
     * the URL will only be usable within NetBeans as it uses a special protocol handler.
1144
     * the URL will only be usable within NetBeans as it uses a special protocol handler.
1134
     * Otherwise an attempt is made to produce an external URL.
1145
     * Otherwise an attempt is made to produce an external URL.
1135
    * @return URL of this file object
1146
    * @return URL of this file object
1136
    * @exception FileStateInvalidException if the file is not valid
1137
     * @see URLMapper#findURL
1147
     * @see URLMapper#findURL
1138
     * @see URLMapper#INTERNAL
1148
     * @see URLMapper#INTERNAL
1149
     * @since 7.57
1139
    */
1150
    */
1140
    public final URL getURL() throws FileStateInvalidException {
1151
    public final URL toURL() {
1141
        // XXX why does this still throw FSIE? need not
1142
        return URLMapper.findURL(this, URLMapper.INTERNAL);
1152
        return URLMapper.findURL(this, URLMapper.INTERNAL);
1143
    }
1153
    }
1144
1154
1145
    /**
1155
    /**
1156
     * Gets a URI for this file.
1157
     * Similar to {@link #toURL}.
1158
     * @return an absolute URI representing this file location
1159
     * @since 7.57
1160
     */
1161
    public final URI toURI() {
1162
        try {
1163
            URI uri = toURL().toURI();
1164
            assert uri.isAbsolute() : uri;
1165
            assert uri.equals(uri.normalize()) : uri;
1166
            return uri;
1167
        } catch (URISyntaxException x) {
1168
            throw new IllegalStateException(x);
1169
        }
1170
    }
1171
1172
    /**
1146
     * Tests if file really exists or is missing. Some operation on it may be restricted.
1173
     * Tests if file really exists or is missing. Some operation on it may be restricted.
1147
     * @return true indicates that the file is missing.
1174
     * @return true indicates that the file is missing.
1148
     * @since 1.9
1175
     * @since 1.9
(-)a/openide.filesystems/src/org/openide/filesystems/FileURL.java (-2 / +1 lines)
 Lines 99-107    Link Here 
99
    /** Provides a URL to access a file object.
99
    /** Provides a URL to access a file object.
100
    * @param fo the file object
100
    * @param fo the file object
101
    * @return a URL using the correct syntax and {@link #PROTOCOL protocol}
101
    * @return a URL using the correct syntax and {@link #PROTOCOL protocol}
102
    * @exception FileStateInvalidException if the file object is not valid (typically, if its filesystem is inconsistent or no longer present)
103
    */
102
    */
104
    public static URL encodeFileObject(FileObject fo) throws FileStateInvalidException {
103
    public static URL encodeFileObject(FileObject fo) {
105
        return NbfsUtil.getURL(fo);
104
        return NbfsUtil.getURL(fo);
106
    }
105
    }
107
106
(-)a/openide.filesystems/src/org/openide/filesystems/NbfsUtil.java (-3 / +7 lines)
 Lines 65-74    Link Here 
65
     * Gets URL with nbfs protocol for passes fo
65
     * Gets URL with nbfs protocol for passes fo
66
     * @param fo
66
     * @param fo
67
     * @return url with nbfs protocol
67
     * @return url with nbfs protocol
68
     * @throws FileStateInvalidException if FileObject somehow corrupted
69
     */
68
     */
70
    static URL getURL(FileObject fo) throws FileStateInvalidException {
69
    static URL getURL(FileObject fo) {
71
        final String fsPart = encodeFsPart(fo);
70
        String fsPart;
71
        try {
72
            fsPart = encodeFsPart(fo);
73
        } catch (FileStateInvalidException x) {
74
            fsPart = "invalid";
75
        }
72
        final String foPart = encodeFoPart(fo);
76
        final String foPart = encodeFoPart(fo);
73
77
74
        final String host = "nbhost"; //NOI18N
78
        final String host = "nbhost"; //NOI18N
(-)a/openide.filesystems/src/org/openide/filesystems/URLMapper.java (-6 / +2 lines)
 Lines 130-136    Link Here 
130
     * <li>inside this machine
130
     * <li>inside this machine
131
     * <li>from networked machines
131
     * <li>from networked machines
132
     * </ul>
132
     * </ul>
133
     * @return a suitable URL, or null
133
     * @return a suitable URL, or (only if not {@link #INTERNAL}) null
134
     */
134
     */
135
    public static URL findURL(FileObject fo, int type) {
135
    public static URL findURL(FileObject fo, int type) {
136
136
 Lines 146-156    Link Here 
146
        // if not resolved yet then internal URL with nbfs protocol is returned
146
        // if not resolved yet then internal URL with nbfs protocol is returned
147
        // XXX this would be better handled by making DefaultURLMapper just return nbfs for INTERNAL when necessary!
147
        // XXX this would be better handled by making DefaultURLMapper just return nbfs for INTERNAL when necessary!
148
        if (type == INTERNAL) {
148
        if (type == INTERNAL) {
149
            try {
149
            return FileURL.encodeFileObject(fo);
150
                return FileURL.encodeFileObject(fo);
151
            } catch (FileStateInvalidException iex) {
152
                // ignore
153
            }
154
        }
150
        }
155
151
156
        return null;
152
        return null;
(-)a/openide.filesystems/test/unit/src/META-INF/upgrade/FileObject.test (+41 lines)
Line 0    Link Here 
1
%%TestCase toURI
2
package test;
3
class C {
4
    org.openide.filesystems.FileObject f;
5
    java.net.URI u() throws Exception {
6
        return f.getURL().toURI();
7
    }
8
}
9
%%=>
10
package test;
11
class C {
12
    org.openide.filesystems.FileObject f;
13
    java.net.URI u() throws Exception {
14
        return f.toURI();
15
    }
16
}
17
%%=>
18
package test;
19
class C {
20
    org.openide.filesystems.FileObject f;
21
    java.net.URI u() throws Exception {
22
        return f.toURL().toURI();
23
    }
24
}
25
26
%%TestCase toURL
27
package test;
28
class C {
29
    org.openide.filesystems.FileObject f;
30
    java.net.URL u() throws IOException {
31
        return f.getURL();
32
    }
33
}
34
%%=>
35
package test;
36
class C {
37
    org.openide.filesystems.FileObject f;
38
    java.net.URL u() throws IOException {
39
        return f.toURL();
40
    }
41
}
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/FileObjectTestHid.java (-8 / +8 lines)
 Lines 1697-1703    Link Here 
1697
    }
1697
    }
1698
1698
1699
1699
1700
    public void testNbfsTransformation () throws FileStateInvalidException{
1700
    public void testNbfsTransformation () {
1701
        checkSetUp();
1701
        checkSetUp();
1702
        // additional check
1702
        // additional check
1703
        String sysName = fs.getSystemName();
1703
        String sysName = fs.getSystemName();
 Lines 1716-1722    Link Here 
1716
        }
1716
        }
1717
    }
1717
    }
1718
1718
1719
    public void testNbfsTransformation2() throws FileStateInvalidException, IOException, SAXException, ParserConfigurationException {
1719
    public void testNbfsTransformation2() throws IOException, SAXException, ParserConfigurationException {
1720
        checkSetUp();
1720
        checkSetUp();
1721
        // additional check
1721
        // additional check
1722
        if (fs.isReadOnly() || root.isReadOnly()) return;
1722
        if (fs.isReadOnly() || root.isReadOnly()) return;
 Lines 1736-1742    Link Here 
1736
            pFactory.setValidating (false);
1736
            pFactory.setValidating (false);
1737
            Parser p = pFactory.newSAXParser().getParser();
1737
            Parser p = pFactory.newSAXParser().getParser();
1738
            p.setDocumentHandler(new HandlerBase());
1738
            p.setDocumentHandler(new HandlerBase());
1739
            URL u = f.getURL();
1739
            URL u = f.toURL();
1740
            p.parse(u.toExternalForm());
1740
            p.parse(u.toExternalForm());
1741
            //
1741
            //
1742
            byte[] b = new byte[10];
1742
            byte[] b = new byte[10];
 Lines 3086-3100    Link Here 
3086
        }
3086
        }
3087
    }
3087
    }
3088
    
3088
    
3089
    /** Test of getURL method, of class org.openide.filesystems.FileObject. */
3089
    public void testToURL() throws Exception {
3090
    public void  testGetURL() throws Exception {
3091
        checkSetUp();
3090
        checkSetUp();
3092
        
3091
        
3093
        FileObject fo1 = getTestFile1 (root);
3092
        FileObject fo1 = getTestFile1 (root);
3094
        URL url = null;
3093
        URL url = null;
3095
        url  = fo1.getURL();
3094
        url  = fo1.toURL();
3096
        /** Only invalid files may fire FileStateInvalidException*/
3095
        /** Only invalid files may fire FileStateInvalidException*/
3097
        fsAssert ("Expected valid url",url != null);                
3096
        fsAssert ("Expected valid url",url != null);
3097
        fsAssert("same URI", url.toURI().equals(fo1.toURI()));
3098
        
3098
        
3099
        // #39613: check that it actually works!
3099
        // #39613: check that it actually works!
3100
        // Note that since getURL now produces a file: URL for files with File's,
3100
        // Note that since getURL now produces a file: URL for files with File's,
 Lines 3102-3108    Link Here 
3102
        FileObject f2 = getTestFile1(root);
3102
        FileObject f2 = getTestFile1(root);
3103
        FileObject f1 = f2.getParent();
3103
        FileObject f1 = f2.getParent();
3104
        assertNotNull("had a parent of " + f2, f1);
3104
        assertNotNull("had a parent of " + f2, f1);
3105
        URL u1 = f1.getURL();
3105
        URL u1 = f1.toURL();
3106
        assertNotNull("had a URL for " + f1, u1);
3106
        assertNotNull("had a URL for " + f1, u1);
3107
        URI uri1 = new URI(u1.toExternalForm());
3107
        URI uri1 = new URI(u1.toExternalForm());
3108
        String path1 = uri1.getPath();
3108
        String path1 = uri1.getPath();
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/FileUtilTest.java (-2 / +2 lines)
 Lines 140-146    Link Here 
140
        clearWorkDir();
140
        clearWorkDir();
141
        lfs.setRootDirectory(getWorkDir());
141
        lfs.setRootDirectory(getWorkDir());
142
        MockLookup.setInstances(new URLMapper() {
142
        MockLookup.setInstances(new URLMapper() {
143
            String rootURL = lfs.getRoot().getURL().toString();
143
            String rootURL = lfs.getRoot().toURL().toString();
144
            @Override
144
            @Override
145
            public FileObject[] getFileObjects(URL url) {
145
            public FileObject[] getFileObjects(URL url) {
146
                String u = url.toString();
146
                String u = url.toString();
 Lines 220-226    Link Here 
220
        final File wd = getWorkDir();
220
        final File wd = getWorkDir();
221
        lfs.setRootDirectory(wd);
221
        lfs.setRootDirectory(wd);
222
        MockLookup.setInstances(new URLMapper() {
222
        MockLookup.setInstances(new URLMapper() {
223
            String rootURL = lfs.getRoot().getURL().toString();
223
            String rootURL = lfs.getRoot().toURL().toString();
224
            @Override
224
            @Override
225
            public FileObject[] getFileObjects(URL url) {
225
            public FileObject[] getFileObjects(URL url) {
226
                String u = url.toString();
226
                String u = url.toString();
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/FilesystemBugsTest.java (-2 / +2 lines)
 Lines 205-211    Link Here 
205
     */
205
     */
206
    public void testURLContract() throws Exception {
206
    public void testURLContract() throws Exception {
207
        FileObject fo = getWriteFolder();
207
        FileObject fo = getWriteFolder();
208
        URL u = fo.getURL();
208
        URL u = fo.toURL();
209
        assertEquals(u, new URL(u.toExternalForm()));
209
        assertEquals(u, new URL(u.toExternalForm()));
210
    }
210
    }
211
211
 Lines 260-266    Link Here 
260
    is now always searched in parent folder.
260
    is now always searched in parent folder.
261
     */
261
     */
262
    public void testFolderSlashUrl() throws Exception {
262
    public void testFolderSlashUrl() throws Exception {
263
        URL u = getWriteFolder().getURL();
263
        URL u = getWriteFolder().toURL();
264
        assertTrue("invalid url of directory", u.getPath().endsWith("/"));
264
        assertTrue("invalid url of directory", u.getPath().endsWith("/"));
265
    }
265
    }
266
266
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/JarFileSystemHidden.java (-2 / +2 lines)
 Lines 67-73    Link Here 
67
67
68
        JarFileSystem fs = new JarFileSystem(f);
68
        JarFileSystem fs = new JarFileSystem(f);
69
69
70
        URL u = fs.getRoot().getURL();
70
        URL u = fs.getRoot().toURL();
71
        assertNotNull("URL is OK", u);
71
        assertNotNull("URL is OK", u);
72
        if (!u.toExternalForm().startsWith("jar:file") || !u.toExternalForm().endsWith("broken.jar!/")) {
72
        if (!u.toExternalForm().startsWith("jar:file") || !u.toExternalForm().endsWith("broken.jar!/")) {
73
            fail("Unexpected URL: " + u);
73
            fail("Unexpected URL: " + u);
 Lines 106-112    Link Here 
106
            fail("The file " + f + " shall not be opened when fs created:\n" + log);
106
            fail("The file " + f + " shall not be opened when fs created:\n" + log);
107
        }
107
        }
108
108
109
        URL u = fs.getRoot().getURL();
109
        URL u = fs.getRoot().toURL();
110
        assertNotNull("URL is OK", u);
110
        assertNotNull("URL is OK", u);
111
        if (!u.toExternalForm().startsWith("jar:file") || !u.toExternalForm().endsWith("ok.jar!/")) {
111
        if (!u.toExternalForm().startsWith("jar:file") || !u.toExternalForm().endsWith("ok.jar!/")) {
112
            fail("Unexpected URL: " + u);
112
            fail("Unexpected URL: " + u);
(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/MemoryFSTestHid.java (-2 / +2 lines)
 Lines 93-99    Link Here 
93
        os.write("hello".getBytes());
93
        os.write("hello".getBytes());
94
        os.close();
94
        os.close();
95
        file.setAttribute("mimeType", "text/x-hello");
95
        file.setAttribute("mimeType", "text/x-hello");
96
        URL u = file.getURL();
96
        URL u = file.toURL();
97
        assertEquals("/folder/file", u.getPath());
97
        assertEquals("/folder/file", u.getPath());
98
        URLConnection conn = u.openConnection();
98
        URLConnection conn = u.openConnection();
99
        conn.connect();
99
        conn.connect();
 Lines 106-112    Link Here 
106
        assertEquals(file, URLMapper.findFileObject(u));
106
        assertEquals(file, URLMapper.findFileObject(u));
107
        assertEquals(null, URLMapper.findURL(file, URLMapper.EXTERNAL));
107
        assertEquals(null, URLMapper.findURL(file, URLMapper.EXTERNAL));
108
        assertEquals(null, URLMapper.findURL(file, URLMapper.NETWORK));
108
        assertEquals(null, URLMapper.findURL(file, URLMapper.NETWORK));
109
        assertEquals(u, new URL(file.getParent().getURL(), file.getNameExt()));
109
        assertEquals(u, new URL(file.getParent().toURL(), file.getNameExt()));
110
    }
110
    }
111
111
112
}
112
}
(-)a/project.ant/nbproject/project.xml (-1 / +1 lines)
 Lines 140-146    Link Here 
140
                    <build-prerequisite/>
140
                    <build-prerequisite/>
141
                    <compile-dependency/>
141
                    <compile-dependency/>
142
                    <run-dependency>
142
                    <run-dependency>
143
                        <specification-version>7.50</specification-version>
143
                        <specification-version>7.57</specification-version>
144
                    </run-dependency>
144
                    </run-dependency>
145
                </dependency>
145
                </dependency>
146
                <dependency>
146
                <dependency>
(-)a/project.ant/src/org/netbeans/modules/project/ant/ProjectLibraryProvider.java (-7 / +1 lines)
 Lines 1178-1190    Link Here 
1178
                URI u;
1178
                URI u;
1179
                FileObject newFO;
1179
                FileObject newFO;
1180
                String name;
1180
                String name;
1181
                URI libEntryU;
1181
                if (CollocationQuery.areCollocated(libBaseFolder.toURI(), libEntryFO.toURI())) {
1182
                try {
1183
                    libEntryU = libEntryFO.getURL().toURI();
1184
                } catch (Exception x) {
1185
                    libEntryU = null;
1186
                }
1187
                if (libEntryU != null && CollocationQuery.areCollocated(libBaseFolder.toURI(), libEntryU)) {
1188
                    // if the jar/folder is in relation to the library folder (parent+child/same vcs)
1182
                    // if the jar/folder is in relation to the library folder (parent+child/same vcs)
1189
                    // don't replicate it but reference the original file.
1183
                    // don't replicate it but reference the original file.
1190
                    newFO = libEntryFO;
1184
                    newFO = libEntryFO;
(-)a/project.ant/src/org/netbeans/modules/project/ant/ProjectXMLCatalogReader.java (-8 / +3 lines)
 Lines 63-69    Link Here 
63
import org.netbeans.modules.xml.catalog.spi.CatalogListener;
63
import org.netbeans.modules.xml.catalog.spi.CatalogListener;
64
import org.netbeans.modules.xml.catalog.spi.CatalogReader;
64
import org.netbeans.modules.xml.catalog.spi.CatalogReader;
65
import org.openide.filesystems.FileObject;
65
import org.openide.filesystems.FileObject;
66
import org.openide.filesystems.FileStateInvalidException;
67
import org.openide.filesystems.FileUtil;
66
import org.openide.filesystems.FileUtil;
68
import org.openide.util.Exceptions;
67
import org.openide.util.Exceptions;
69
import org.openide.util.ImageUtilities;
68
import org.openide.util.ImageUtilities;
 Lines 96-106    Link Here 
96
        if (name.startsWith(PREFIX)) {
95
        if (name.startsWith(PREFIX)) {
97
            FileObject rsrc = FileUtil.getConfigFile(CATALOG + "/" + name.substring(PREFIX.length()) + "." + EXTENSION);
96
            FileObject rsrc = FileUtil.getConfigFile(CATALOG + "/" + name.substring(PREFIX.length()) + "." + EXTENSION);
98
            if (rsrc != null) {
97
            if (rsrc != null) {
99
                try {
98
                return rsrc.toURL().toString();
100
                    return rsrc.getURL().toString();
101
                } catch (FileStateInvalidException x) {
102
                    Exceptions.printStackTrace(x);
103
                }
104
            }
99
            }
105
        }
100
        }
106
        return null;
101
        return null;
 Lines 179-185    Link Here 
179
                    try {
174
                    try {
180
                        InputStream is = f.getInputStream();
175
                        InputStream is = f.getInputStream();
181
                        streams.add(is);
176
                        streams.add(is);
182
                        sources.add(new StreamSource(is, f.getURL().toString()));
177
                        sources.add(new StreamSource(is, f.toURL().toString()));
183
                    } catch (IOException x) {
178
                    } catch (IOException x) {
184
                        Exceptions.printStackTrace(x);
179
                        Exceptions.printStackTrace(x);
185
                    }
180
                    }
 Lines 192-198    Link Here 
192
                    // Try to determine the culprit and report appropriately.
187
                    // Try to determine the culprit and report appropriately.
193
                    for (FileObject f : schemas) {
188
                    for (FileObject f : schemas) {
194
                        try {
189
                        try {
195
                            schemaFactory.newSchema(new StreamSource(f.getURL().toString()));
190
                            schemaFactory.newSchema(new StreamSource(f.toURL().toString()));
196
                        } catch (Exception x2) {
191
                        } catch (Exception x2) {
197
                            Exceptions.attachMessage(x2, "While parsing: " + f.getPath()); // NOI18N
192
                            Exceptions.attachMessage(x2, "While parsing: " + f.getPath()); // NOI18N
198
                            Exceptions.printStackTrace(x2);
193
                            Exceptions.printStackTrace(x2);
(-)a/project.ant/src/org/netbeans/spi/project/support/ant/GeneratedFilesHelper.java (-2 / +2 lines)
 Lines 691-697    Link Here 
691
    
691
    
692
    /** Find (maybe cached) CRC for a file, using a preexisting input stream (not closed by this method). */
692
    /** Find (maybe cached) CRC for a file, using a preexisting input stream (not closed by this method). */
693
    private static String getCrc32(InputStream is, FileObject fo) throws IOException {
693
    private static String getCrc32(InputStream is, FileObject fo) throws IOException {
694
        URL u = fo.getURL();
694
        URL u = fo.toURL();
695
        fo.refresh(); // in case was written on disk and we did not notice yet...
695
        fo.refresh(); // in case was written on disk and we did not notice yet...
696
        long footprint = fo.lastModified().getTime() ^ fo.getSize();
696
        long footprint = fo.lastModified().getTime() ^ fo.getSize();
697
        String crc = findCachedCrc32(u, footprint);
697
        String crc = findCachedCrc32(u, footprint);
 Lines 730-736    Link Here 
730
    
730
    
731
    /** Find (maybe cached) CRC for a file. Will open its own input stream. */
731
    /** Find (maybe cached) CRC for a file. Will open its own input stream. */
732
    private static String getCrc32(FileObject fo) throws IOException {
732
    private static String getCrc32(FileObject fo) throws IOException {
733
        URL u = fo.getURL();
733
        URL u = fo.toURL();
734
        fo.refresh();
734
        fo.refresh();
735
        long footprint = fo.lastModified().getTime() ^ fo.getSize();
735
        long footprint = fo.lastModified().getTime() ^ fo.getSize();
736
        String crc = findCachedCrc32(u, footprint);
736
        String crc = findCachedCrc32(u, footprint);
(-)a/project.ant/src/org/netbeans/spi/project/support/ant/SourcesHelper.java (-6 / +2 lines)
 Lines 69-74    Link Here 
69
import org.netbeans.api.project.ProjectManager;
69
import org.netbeans.api.project.ProjectManager;
70
import org.netbeans.api.project.ProjectUtils;
70
import org.netbeans.api.project.ProjectUtils;
71
import org.netbeans.api.project.SourceGroup;
71
import org.netbeans.api.project.SourceGroup;
72
import org.netbeans.api.project.SourceGroupModifier;
72
import org.netbeans.api.project.Sources;
73
import org.netbeans.api.project.Sources;
73
import org.netbeans.api.queries.SharabilityQuery;
74
import org.netbeans.api.queries.SharabilityQuery;
74
import org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton;
75
import org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton;
 Lines 78-84    Link Here 
78
import org.openide.filesystems.FileEvent;
79
import org.openide.filesystems.FileEvent;
79
import org.openide.filesystems.FileObject;
80
import org.openide.filesystems.FileObject;
80
import org.openide.filesystems.FileRenameEvent;
81
import org.openide.filesystems.FileRenameEvent;
81
import org.openide.filesystems.FileStateInvalidException;
82
import org.openide.filesystems.FileUtil;
82
import org.openide.filesystems.FileUtil;
83
import org.openide.util.ChangeSupport;
83
import org.openide.util.ChangeSupport;
84
import org.openide.util.Parameters;
84
import org.openide.util.Parameters;
 Lines 1019-1029    Link Here 
1019
            // Remember what we computed here so we know whether to fire changes later.
1019
            // Remember what we computed here so we know whether to fire changes later.
1020
            List<URL> rootURLs = new ArrayList<URL>(groups.size());
1020
            List<URL> rootURLs = new ArrayList<URL>(groups.size());
1021
            for (SourceGroup g : groups) {
1021
            for (SourceGroup g : groups) {
1022
                try {
1022
                rootURLs.add(g.getRootFolder().toURL());
1023
                    rootURLs.add(g.getRootFolder().getURL());
1024
                } catch (FileStateInvalidException e) {
1025
                    assert false : e; // should be a valid file object!
1026
                }
1027
            }
1023
            }
1028
            lastComputedRoots.put(type, rootURLs);
1024
            lastComputedRoots.put(type, rootURLs);
1029
            return groups.toArray(new SourceGroup[groups.size()]);
1025
            return groups.toArray(new SourceGroup[groups.size()]);
(-)a/project.ant/test/unit/src/org/netbeans/spi/project/support/ant/ReferenceHelperTest.java (-3 / +3 lines)
 Lines 171-177    Link Here 
171
        assertNotNull("found ref helper for " + p, r);
171
        assertNotNull("found ref helper for " + p, r);
172
        sisterprojdir = FileUtil.createFolder(scratch, "proj2");
172
        sisterprojdir = FileUtil.createFolder(scratch, "proj2");
173
        assertTrue("projdir and sisterprojdir collocated",
173
        assertTrue("projdir and sisterprojdir collocated",
174
            CollocationQuery.areCollocated(projdir.getURL().toURI(), sisterprojdir.getURL().toURI()));
174
            CollocationQuery.areCollocated(projdir.toURI(), sisterprojdir.toURI()));
175
        sisterh = ProjectGenerator.createProject(sisterprojdir, "test");
175
        sisterh = ProjectGenerator.createProject(sisterprojdir, "test");
176
        setCodeNameOfTestProject(sisterh, "proj2");
176
        setCodeNameOfTestProject(sisterh, "proj2");
177
        EditableProperties props = sisterh.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
177
        EditableProperties props = sisterh.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
 Lines 183-189    Link Here 
183
        
183
        
184
        sisterprojdir2 = FileUtil.createFolder(scratch, "proj2-copy");
184
        sisterprojdir2 = FileUtil.createFolder(scratch, "proj2-copy");
185
        assertTrue("projdir and sisterprojdir2 collocated",
185
        assertTrue("projdir and sisterprojdir2 collocated",
186
            CollocationQuery.areCollocated(projdir.getURL().toURI(), sisterprojdir2.getURL().toURI()));
186
            CollocationQuery.areCollocated(projdir.toURI(), sisterprojdir2.toURI()));
187
        sisterh2 = ProjectGenerator.createProject(sisterprojdir2, "test");
187
        sisterh2 = ProjectGenerator.createProject(sisterprojdir2, "test");
188
        setCodeNameOfTestProject(sisterh2, "proj2");
188
        setCodeNameOfTestProject(sisterh2, "proj2");
189
        props = sisterh2.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
189
        props = sisterh2.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
 Lines 198-204    Link Here 
198
        // similarly as it is done for SampleCVSCollocationQueryImpl
198
        // similarly as it is done for SampleCVSCollocationQueryImpl
199
        // in META-INF/services.
199
        // in META-INF/services.
200
        assertFalse("" + projdir + " and " + sepprojdir + " cannot be collocated",
200
        assertFalse("" + projdir + " and " + sepprojdir + " cannot be collocated",
201
            CollocationQuery.areCollocated(projdir.getURL().toURI(), sepprojdir.getURL().toURI()));
201
            CollocationQuery.areCollocated(projdir.toURI(), sepprojdir.toURI()));
202
        seph = ProjectGenerator.createProject(sepprojdir, "test");
202
        seph = ProjectGenerator.createProject(sepprojdir, "test");
203
        setCodeNameOfTestProject(seph, "proj3");
203
        setCodeNameOfTestProject(seph, "proj3");
204
        props = seph.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
204
        props = seph.getProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH);
(-)a/projectapi/nbproject/project.xml (-1 / +1 lines)
 Lines 63-69    Link Here 
63
                    <build-prerequisite/>
63
                    <build-prerequisite/>
64
                    <compile-dependency/>
64
                    <compile-dependency/>
65
                    <run-dependency>
65
                    <run-dependency>
66
                        <specification-version>7.50</specification-version>
66
                        <specification-version>7.57</specification-version>
67
                    </run-dependency>
67
                    </run-dependency>
68
                </dependency>
68
                </dependency>
69
                <dependency>
69
                <dependency>
(-)a/projectapi/src/org/netbeans/api/project/ProjectUtils.java (-6 / +1 lines)
 Lines 67-73    Link Here 
67
import org.netbeans.spi.project.SubprojectProvider;
67
import org.netbeans.spi.project.SubprojectProvider;
68
import org.netbeans.spi.project.support.GenericSources;
68
import org.netbeans.spi.project.support.GenericSources;
69
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileStateInvalidException;
71
import org.openide.filesystems.FileUtil;
70
import org.openide.filesystems.FileUtil;
72
import org.openide.util.ImageUtilities;
71
import org.openide.util.ImageUtilities;
73
import org.openide.util.Lookup;
72
import org.openide.util.Lookup;
 Lines 235-245    Link Here 
235
        }
234
        }
236
        
235
        
237
        public String getName() {
236
        public String getName() {
238
            try {
237
            return p.getProjectDirectory().toURL().toExternalForm();
239
                return p.getProjectDirectory().getURL().toExternalForm();
240
            } catch (FileStateInvalidException e) {
241
                return e.toString();
242
            }
243
        }
238
        }
244
        
239
        
245
        public String getDisplayName() {
240
        public String getDisplayName() {
(-)a/projectapi/src/org/netbeans/modules/projectapi/AuxiliaryConfigImpl.java (-3 / +3 lines)
 Lines 103-109    Link Here 
103
                            InputStream is = config.getInputStream();
103
                            InputStream is = config.getInputStream();
104
                            try {
104
                            try {
105
                                InputSource input = new InputSource(is);
105
                                InputSource input = new InputSource(is);
106
                                input.setSystemId(config.getURL().toString());
106
                                input.setSystemId(config.toURL().toString());
107
                                Element root = XMLUtil.parse(input, false, true, /*XXX*/null, null).getDocumentElement();
107
                                Element root = XMLUtil.parse(input, false, true, /*XXX*/null, null).getDocumentElement();
108
                                return XMLUtil.findElement(root, elementName, namespace);
108
                                return XMLUtil.findElement(root, elementName, namespace);
109
                            } finally {
109
                            } finally {
 Lines 160-166    Link Here 
160
                            InputStream is = config.getInputStream();
160
                            InputStream is = config.getInputStream();
161
                            try {
161
                            try {
162
                                InputSource input = new InputSource(is);
162
                                InputSource input = new InputSource(is);
163
                                input.setSystemId(config.getURL().toString());
163
                                input.setSystemId(config.toURL().toString());
164
                                doc = XMLUtil.parse(input, false, true, /*XXX*/ null, null);
164
                                doc = XMLUtil.parse(input, false, true, /*XXX*/ null, null);
165
                            } finally {
165
                            } finally {
166
                                is.close();
166
                                is.close();
 Lines 231-237    Link Here 
231
                        InputStream is = config.getInputStream();
231
                        InputStream is = config.getInputStream();
232
                        try {
232
                        try {
233
                            InputSource input = new InputSource(is);
233
                            InputSource input = new InputSource(is);
234
                            input.setSystemId(config.getURL().toString());
234
                            input.setSystemId(config.toURL().toString());
235
                            doc = XMLUtil.parse(input, false, true, /*XXX*/ null, null);
235
                            doc = XMLUtil.parse(input, false, true, /*XXX*/ null, null);
236
                        } finally {
236
                        } finally {
237
                            is.close();
237
                            is.close();
(-)a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java (-16 / +4 lines)
 Lines 51-63    Link Here 
51
import java.net.URI;
51
import java.net.URI;
52
import java.net.URISyntaxException;
52
import java.net.URISyntaxException;
53
import java.net.URL;
53
import java.net.URL;
54
import java.util.Collection;
55
import java.util.Collections;
54
import java.util.Collections;
56
import java.util.HashMap;
55
import java.util.HashMap;
57
import java.util.LinkedList;
58
import java.util.Map;
56
import java.util.Map;
59
import java.util.Set;
57
import java.util.Set;
60
import java.util.WeakHashMap;
61
import java.util.logging.Level;
58
import java.util.logging.Level;
62
import java.util.logging.Logger;
59
import java.util.logging.Logger;
63
import java.util.prefs.BackingStoreException;
60
import java.util.prefs.BackingStoreException;
 Lines 66-72    Link Here 
66
import org.netbeans.api.project.ProjectManager;
63
import org.netbeans.api.project.ProjectManager;
67
import org.netbeans.spi.project.FileOwnerQueryImplementation;
64
import org.netbeans.spi.project.FileOwnerQueryImplementation;
68
import org.openide.filesystems.FileObject;
65
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileStateInvalidException;
70
import org.openide.filesystems.URLMapper;
66
import org.openide.filesystems.URLMapper;
71
import org.openide.util.NbPreferences;
67
import org.openide.util.NbPreferences;
72
import org.openide.util.Utilities;
68
import org.openide.util.Utilities;
 Lines 146-152    Link Here 
146
            }
142
            }
147
            
143
            
148
            if (!externalOwners.isEmpty() && (folder || externalRootsIncludeNonFolders)) {
144
            if (!externalOwners.isEmpty() && (folder || externalRootsIncludeNonFolders)) {
149
                URI externalOwnersURI = externalOwners.get(fileObject2URI(f));
145
                URI externalOwnersURI = externalOwners.get(f.toURI());
150
146
151
                if (externalOwnersURI != null) {
147
                if (externalOwnersURI != null) {
152
                    FileObject externalOwner = uri2FileObject(externalOwnersURI);
148
                    FileObject externalOwner = uri2FileObject(externalOwnersURI);
 Lines 169-175    Link Here 
169
                }
165
                }
170
            }
166
            }
171
            if (!deserializedExternalOwners.isEmpty() && (folder || externalRootsIncludeNonFolders)) {
167
            if (!deserializedExternalOwners.isEmpty() && (folder || externalRootsIncludeNonFolders)) {
172
                FileObject externalOwner = deserializedExternalOwners.get(fileObject2URI(f));
168
                FileObject externalOwner = deserializedExternalOwners.get(f.toURI());
173
                if (externalOwner != null && externalOwner.isValid()) {
169
                if (externalOwner != null && externalOwner.isValid()) {
174
                    try {
170
                    try {
175
                        // Note: will be null if there is no such project.
171
                        // Note: will be null if there is no such project.
 Lines 241-257    Link Here 
241
        externalOwners.clear();
237
        externalOwners.clear();
242
    }
238
    }
243
    
239
    
244
    private static URI fileObject2URI(FileObject f) {
245
        try {
246
            return URI.create(f.getURL().toString());
247
        } catch (FileStateInvalidException e) {
248
            throw (IllegalArgumentException) new IllegalArgumentException(e.toString()).initCause(e);
249
        }
250
    }
251
    
252
    /** @see FileOwnerQuery#markExternalOwner */
240
    /** @see FileOwnerQuery#markExternalOwner */
253
    public static void markExternalOwnerTransient(FileObject root, Project owner) {
241
    public static void markExternalOwnerTransient(FileObject root, Project owner) {
254
        markExternalOwnerTransient(fileObject2URI(root), owner);
242
        markExternalOwnerTransient(root.toURI(), owner);
255
    }
243
    }
256
    
244
    
257
    /** @see FileOwnerQuery#markExternalOwner */
245
    /** @see FileOwnerQuery#markExternalOwner */
 Lines 259-265    Link Here 
259
        externalRootsIncludeNonFolders |= !root.getPath().endsWith("/");
247
        externalRootsIncludeNonFolders |= !root.getPath().endsWith("/");
260
        if (owner != null) {
248
        if (owner != null) {
261
            FileObject fo = owner.getProjectDirectory();
249
            FileObject fo = owner.getProjectDirectory();
262
            externalOwners.put(root, fileObject2URI(fo));
250
            externalOwners.put(root, fo.toURI());
263
            deserializedExternalOwners.remove(root);
251
            deserializedExternalOwners.remove(root);
264
        } else {
252
        } else {
265
            externalOwners.remove(root);
253
            externalOwners.remove(root);
(-)a/projectapi/test/unit/src/org/netbeans/api/project/FileOwnerQueryTest.java (-34 / +30 lines)
 Lines 143-151    Link Here 
143
    
143
    
144
    public void testJarOwners() throws Exception {
144
    public void testJarOwners() throws Exception {
145
        assertEquals("correct owner of a ZIPped file", p, FileOwnerQuery.getOwner(zippedfile));
145
        assertEquals("correct owner of a ZIPped file", p, FileOwnerQuery.getOwner(zippedfile));
146
        assertEquals("correct owner of a ZIPped file URL", p, FileOwnerQuery.getOwner(URI.create(zippedfile.getURL().toExternalForm())));
146
        assertEquals("correct owner of a ZIPped file URL", p, FileOwnerQuery.getOwner(URI.create(zippedfile.toURL().toExternalForm())));
147
        assertEquals("correct owner of a ZIPped file", p, FileOwnerQuery.getOwner(hashedFile));
147
        assertEquals("correct owner of a ZIPped file", p, FileOwnerQuery.getOwner(hashedFile));
148
        assertEquals("correct owner of a ZIPped file URL", p, FileOwnerQuery.getOwner(URI.create(hashedFile.getURL().toExternalForm())));
148
        assertEquals("correct owner of a ZIPped file URL", p, FileOwnerQuery.getOwner(URI.create(hashedFile.toURL().toExternalForm())));
149
    }
149
    }
150
    
150
    
151
    public void testExternalOwner() throws Exception {
151
    public void testExternalOwner() throws Exception {
 Lines 203-270    Link Here 
203
        FileObject extfile1 = ext1.getFileObject("subdir/file");
203
        FileObject extfile1 = ext1.getFileObject("subdir/file");
204
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile1));
204
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile1));
205
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(extfile1));
205
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(extfile1));
206
        FileOwnerQuery.markExternalOwner(fileObject2URI(ext1), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
206
        FileOwnerQuery.markExternalOwner(ext1.toURI(), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
207
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
207
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
208
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(fileObject2URI(extfile1)));
208
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(extfile1.toURI()));
209
        assertEquals("even for the projdir throught FileObjects", p, FileOwnerQuery.getOwner(ext1));
209
        assertEquals("even for the projdir throught FileObjects", p, FileOwnerQuery.getOwner(ext1));
210
        assertEquals("even for the projdir throught URI", p, FileOwnerQuery.getOwner(fileObject2URI(ext1)));
210
        assertEquals("even for the projdir throught URI", p, FileOwnerQuery.getOwner(ext1.toURI()));
211
        assertEquals("but not for something else throught FileObjects", null, FileOwnerQuery.getOwner(scratch));
211
        assertEquals("but not for something else throught FileObjects", null, FileOwnerQuery.getOwner(scratch));
212
        assertEquals("but not for something else throught URI", null, FileOwnerQuery.getOwner(fileObject2URI(scratch)));
212
        assertEquals("but not for something else throught URI", null, FileOwnerQuery.getOwner(scratch.toURI()));
213
        FileObject ext2 = scratch.getFileObject("external2");
213
        FileObject ext2 = scratch.getFileObject("external2");
214
        FileObject extfile2 = ext2.getFileObject("subdir/file");
214
        FileObject extfile2 = ext2.getFileObject("subdir/file");
215
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile2));
215
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile2));
216
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(fileObject2URI(extfile2)));
216
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(extfile2.toURI()));
217
        Project p2 = ProjectManager.getDefault().findProject(subprojdir);
217
        Project p2 = ProjectManager.getDefault().findProject(subprojdir);
218
        FileOwnerQuery.markExternalOwner(fileObject2URI(ext2), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
218
        FileOwnerQuery.markExternalOwner(ext2.toURI(), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
219
        assertEquals("now have an owner through FileObjects", p2, FileOwnerQuery.getOwner(extfile2));
219
        assertEquals("now have an owner through FileObjects", p2, FileOwnerQuery.getOwner(extfile2));
220
        assertEquals("now have an owner through URI", p2, FileOwnerQuery.getOwner(fileObject2URI(extfile2)));
220
        assertEquals("now have an owner through URI", p2, FileOwnerQuery.getOwner(extfile2.toURI()));
221
        assertEquals("even for the projdir through FileObjects", p2, FileOwnerQuery.getOwner(ext2));
221
        assertEquals("even for the projdir through FileObjects", p2, FileOwnerQuery.getOwner(ext2));
222
        assertEquals("even for the projdir through URI", p2, FileOwnerQuery.getOwner(ext2));
222
        assertEquals("even for the projdir through URI", p2, FileOwnerQuery.getOwner(ext2));
223
        assertEquals("but not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
223
        assertEquals("but not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
224
        assertEquals("but not for something else through URI", null, FileOwnerQuery.getOwner(fileObject2URI(scratch)));
224
        assertEquals("but not for something else through URI", null, FileOwnerQuery.getOwner(scratch.toURI()));
225
        assertEquals("still correct for first proj through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
225
        assertEquals("still correct for first proj through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
226
        assertEquals("still correct for first proj through URI", p, FileOwnerQuery.getOwner(fileObject2URI(extfile1)));
226
        assertEquals("still correct for first proj through URI", p, FileOwnerQuery.getOwner(extfile1.toURI()));
227
        FileObject ext3 = scratch.getFileObject("external3");
227
        FileObject ext3 = scratch.getFileObject("external3");
228
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(ext3));
228
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(ext3));
229
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(fileObject2URI(ext3)));
229
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(ext3.toURI()));
230
        FileOwnerQuery.markExternalOwner(fileObject2URI(ext3), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
230
        FileOwnerQuery.markExternalOwner(ext3.toURI(), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
231
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(ext3));
231
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(ext3));
232
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(fileObject2URI(ext3)));
232
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(ext3.toURI()));
233
        FileObject ext3subproj = ext3.getFileObject("subproject");
233
        FileObject ext3subproj = ext3.getFileObject("subproject");
234
        Project p3 = FileOwnerQuery.getOwner(ext3subproj);
234
        Project p3 = FileOwnerQuery.getOwner(ext3subproj);
235
        assertNotSame("different project", p, p3);
235
        assertNotSame("different project", p, p3);
236
        assertEquals("but subprojects are not part of it", ProjectManager.getDefault().findProject(ext3subproj), p3);
236
        assertEquals("but subprojects are not part of it", ProjectManager.getDefault().findProject(ext3subproj), p3);
237
        FileOwnerQuery.markExternalOwner(fileObject2URI(ext3), null, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
237
        FileOwnerQuery.markExternalOwner(ext3.toURI(), null, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
238
        assertEquals("unmarking an owner works through FileObjects", null, FileOwnerQuery.getOwner(ext3));
238
        assertEquals("unmarking an owner works through FileObjects", null, FileOwnerQuery.getOwner(ext3));
239
        assertEquals("unmarking an owner works through URI", null, FileOwnerQuery.getOwner(fileObject2URI(ext3)));
239
        assertEquals("unmarking an owner works through URI", null, FileOwnerQuery.getOwner(ext3.toURI()));
240
    }
240
    }
241
    
241
    
242
    public void testExternalOwnerFileURI() throws Exception {
242
    public void testExternalOwnerFileURI() throws Exception {
243
        FileObject ext1 = scratch.getFileObject("external1");
243
        FileObject ext1 = scratch.getFileObject("external1");
244
        FileObject extfile1 = ext1.getFileObject("subdir/file");
244
        FileObject extfile1 = ext1.getFileObject("subdir/file");
245
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile1));
245
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile1));
246
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(fileObject2URI(extfile1)));
246
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(extfile1.toURI()));
247
        FileOwnerQuery.markExternalOwner(fileObject2URI(extfile1), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
247
        FileOwnerQuery.markExternalOwner(extfile1.toURI(), p, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
248
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
248
        assertEquals("now have an owner through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
249
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(fileObject2URI(extfile1)));
249
        assertEquals("now have an owner through URI", p, FileOwnerQuery.getOwner(extfile1.toURI()));
250
        assertEquals("not for the projdir through FileObjects", null, FileOwnerQuery.getOwner(ext1));
250
        assertEquals("not for the projdir through FileObjects", null, FileOwnerQuery.getOwner(ext1));
251
        assertEquals("not for the projdir through URI", null, FileOwnerQuery.getOwner(fileObject2URI(ext1)));
251
        assertEquals("not for the projdir through URI", null, FileOwnerQuery.getOwner(ext1.toURI()));
252
        assertEquals("and not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
252
        assertEquals("and not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
253
        assertEquals("and not for something else through URI", null, FileOwnerQuery.getOwner(fileObject2URI(scratch)));
253
        assertEquals("and not for something else through URI", null, FileOwnerQuery.getOwner(scratch.toURI()));
254
        FileObject ext2 = scratch.getFileObject("external2");
254
        FileObject ext2 = scratch.getFileObject("external2");
255
        FileObject extfile2 = ext2.getFileObject("subdir/file");
255
        FileObject extfile2 = ext2.getFileObject("subdir/file");
256
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile2));
256
        assertEquals("no owner yet through FileObjects", null, FileOwnerQuery.getOwner(extfile2));
257
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(fileObject2URI(extfile2)));
257
        assertEquals("no owner yet through URI", null, FileOwnerQuery.getOwner(extfile2.toURI()));
258
        Project p2 = ProjectManager.getDefault().findProject(subprojdir);
258
        Project p2 = ProjectManager.getDefault().findProject(subprojdir);
259
        FileOwnerQuery.markExternalOwner(fileObject2URI(extfile2), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
259
        FileOwnerQuery.markExternalOwner(extfile2.toURI(), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
260
        assertEquals("now have an owner through FileObjects", p2, FileOwnerQuery.getOwner(extfile2));
260
        assertEquals("now have an owner through FileObjects", p2, FileOwnerQuery.getOwner(extfile2));
261
        assertEquals("now have an owner through URI", p2, FileOwnerQuery.getOwner(fileObject2URI(extfile2)));
261
        assertEquals("now have an owner through URI", p2, FileOwnerQuery.getOwner(extfile2.toURI()));
262
        assertEquals("not for the projdir through FileObjects", null, FileOwnerQuery.getOwner(ext2));
262
        assertEquals("not for the projdir through FileObjects", null, FileOwnerQuery.getOwner(ext2));
263
        assertEquals("not for the projdir through URI", null, FileOwnerQuery.getOwner(fileObject2URI(ext2)));
263
        assertEquals("not for the projdir through URI", null, FileOwnerQuery.getOwner(ext2.toURI()));
264
        assertEquals("and not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
264
        assertEquals("and not for something else through FileObjects", null, FileOwnerQuery.getOwner(scratch));
265
        assertEquals("and not for something else through URI", null, FileOwnerQuery.getOwner(fileObject2URI(scratch)));
265
        assertEquals("and not for something else through URI", null, FileOwnerQuery.getOwner(scratch.toURI()));
266
        assertEquals("still correct for first proj through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
266
        assertEquals("still correct for first proj through FileObjects", p, FileOwnerQuery.getOwner(extfile1));
267
        assertEquals("still correct for first proj through URI", p, FileOwnerQuery.getOwner(fileObject2URI(extfile1)));
267
        assertEquals("still correct for first proj through URI", p, FileOwnerQuery.getOwner(extfile1.toURI()));
268
        
268
        
269
        //XXX: unmarking files.
269
        //XXX: unmarking files.
270
    }
270
    }
 Lines 275-281    Link Here 
275
        FileObject tempPrjDir = tempPrjMarker.getParent();
275
        FileObject tempPrjDir = tempPrjMarker.getParent();
276
        Project tempPrj = ProjectManager.getDefault().findProject(tempPrjDir);
276
        Project tempPrj = ProjectManager.getDefault().findProject(tempPrjDir);
277
        assertNotNull(tempPrj);
277
        assertNotNull(tempPrj);
278
        FileOwnerQuery.markExternalOwner(fileObject2URI(ext1), tempPrj, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
278
        FileOwnerQuery.markExternalOwner(ext1.toURI(), tempPrj, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
279
        assertEquals("now have an owner", tempPrj, FileOwnerQuery.getOwner(ext1));
279
        assertEquals("now have an owner", tempPrj, FileOwnerQuery.getOwner(ext1));
280
        Reference<FileObject> r = new WeakReference<FileObject>(tempPrjDir);
280
        Reference<FileObject> r = new WeakReference<FileObject>(tempPrjDir);
281
        tempPrjMarker = tempPrjDir = null;
281
        tempPrjMarker = tempPrjDir = null;
 Lines 290-296    Link Here 
290
        FileObject ext2 = scratch.getFileObject("external2");
290
        FileObject ext2 = scratch.getFileObject("external2");
291
        FileObject extfile2 = ext2.getFileObject("subdir/file");
291
        FileObject extfile2 = ext2.getFileObject("subdir/file");
292
        
292
        
293
        FileOwnerQuery.markExternalOwner(fileObject2URI(extfile2), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
293
        FileOwnerQuery.markExternalOwner(extfile2.toURI(), p2, FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT);
294
        
294
        
295
        Reference<?> p2WR = new WeakReference<Object>(p2);
295
        Reference<?> p2WR = new WeakReference<Object>(p2);
296
        Reference<?> rootWR = new WeakReference<Object>(root);
296
        Reference<?> rootWR = new WeakReference<Object>(root);
 Lines 325-339    Link Here 
325
        assertEquals("still correct for the first external root", p, FileOwnerQuery.getOwner(ext1));
325
        assertEquals("still correct for the first external root", p, FileOwnerQuery.getOwner(ext1));
326
    }
326
    }
327
    
327
    
328
    private static URI fileObject2URI(FileObject f) throws Exception {
329
        return URI.create(f.getURL().toString());
330
    }
331
    
332
    // XXX test URI usage of external owner
328
    // XXX test URI usage of external owner
333
    // XXX test GC of roots and projects used in external ownership:
329
    // XXX test GC of roots and projects used in external ownership:
334
    // - the owning Project is not held strongly (just PM's soft cache)
330
    // - the owning Project is not held strongly (just PM's soft cache)
335
    // - the root is not held strongly (note - FOQ won't be accurate after it is collected)
331
    // - the root is not held strongly (note - FOQ won't be accurate after it is collected)
336
    // XXX test IAE from illegal calls to FOQ.markExternalOwner
332
    // XXX test IAE from illegal calls to FOQ.markExternalOwner
337
    // XXX test an owner which is above the project directory
333
    // XXX test an owner which is above the project directory
338
    
334
339
}
335
}
(-)a/projectapi/test/unit/src/org/netbeans/modules/projectapi/FileOwnerCollocationQueryImplTest.java (-7 / +7 lines)
 Lines 74-80    Link Here 
74
        
74
        
75
        //root/prj1/foo
75
        //root/prj1/foo
76
        FileOwnerCollocationQueryImpl instance = new FileOwnerCollocationQueryImpl();
76
        FileOwnerCollocationQueryImpl instance = new FileOwnerCollocationQueryImpl();
77
        assertEquals(projdir.getURL().toURI(), instance.findRoot(projdir.createData("foo").getURL().toURI()));
77
        assertEquals(projdir.toURI(), instance.findRoot(projdir.createData("foo").toURI()));
78
        
78
        
79
        //root/prj2/foo/prj3/bar
79
        //root/prj2/foo/prj3/bar
80
        projdir = root.createFolder("prj2");
80
        projdir = root.createFolder("prj2");
 Lines 82-91    Link Here 
82
        projdir.createFolder("testproject");
82
        projdir.createFolder("testproject");
83
        projdir = projdir.createFolder("foo").createFolder("prj3");
83
        projdir = projdir.createFolder("foo").createFolder("prj3");
84
        projdir.createFolder("testproject");
84
        projdir.createFolder("testproject");
85
        assertEquals(expected.getURL().toURI(), instance.findRoot(projdir.createData("bar").getURL().toURI()));
85
        assertEquals(expected.toURI(), instance.findRoot(projdir.createData("bar").toURI()));
86
        
86
        
87
        //root
87
        //root
88
        assertEquals(null, instance.findRoot(root.getURL().toURI()));
88
        assertEquals(null, instance.findRoot(root.toURI()));
89
    }
89
    }
90
90
91
    /**
91
    /**
 Lines 101-114    Link Here 
101
        FileObject file1 = lib.createData("pron");
101
        FileObject file1 = lib.createData("pron");
102
        FileObject file2 = projdir.createData("xxx");
102
        FileObject file2 = projdir.createData("xxx");
103
        FileOwnerCollocationQueryImpl instance = new FileOwnerCollocationQueryImpl();
103
        FileOwnerCollocationQueryImpl instance = new FileOwnerCollocationQueryImpl();
104
        assertFalse(instance.areCollocated(file1.getURL().toURI(), file2.getURL().toURI()));
104
        assertFalse(instance.areCollocated(file1.toURI(), file2.toURI()));
105
        file1 = projdir.createData("pron");
105
        file1 = projdir.createData("pron");
106
        assertTrue(instance.areCollocated(file1.getURL().toURI(), file2.getURL().toURI()));
106
        assertTrue(instance.areCollocated(file1.toURI(), file2.toURI()));
107
        
107
        
108
        
108
        
109
        file1 = projdir;
109
        file1 = projdir;
110
        file2 = lib;
110
        file2 = lib;
111
        assertFalse(instance.areCollocated(file1.getURL().toURI(), file2.getURL().toURI()));
111
        assertFalse(instance.areCollocated(file1.toURI(), file2.toURI()));
112
        
112
        
113
        projdir = root.createFolder("noproj").createFolder("proj1");
113
        projdir = root.createFolder("noproj").createFolder("proj1");
114
        projdir.createFolder("testproject");
114
        projdir.createFolder("testproject");
 Lines 118-124    Link Here 
118
        file2 = projdir2.createData("bar");
118
        file2 = projdir2.createData("bar");
119
//        System.out.println("root1=" + instance.findRoot(file1.getURL().toURI()));
119
//        System.out.println("root1=" + instance.findRoot(file1.getURL().toURI()));
120
//        System.out.println("root2=" + instance.findRoot(file2.getURL().toURI()));
120
//        System.out.println("root2=" + instance.findRoot(file2.getURL().toURI()));
121
        assertFalse(instance.areCollocated(file1.getURL().toURI(), file2.getURL().toURI()));
121
        assertFalse(instance.areCollocated(file1.toURI(), file2.toURI()));
122
        
122
        
123
    }
123
    }
124
124
(-)a/projectui/nbproject/project.xml (-1 / +1 lines)
 Lines 167-173    Link Here 
167
                    <build-prerequisite/>
167
                    <build-prerequisite/>
168
                    <compile-dependency/>
168
                    <compile-dependency/>
169
                    <run-dependency>
169
                    <run-dependency>
170
                        <specification-version>7.49</specification-version>
170
                        <specification-version>7.57</specification-version>
171
                    </run-dependency>
171
                    </run-dependency>
172
                </dependency>
172
                </dependency>
173
                <dependency>
173
                <dependency>
(-)a/projectui/src/org/netbeans/modules/project/ui/OpenProjectList.java (-42 / +8 lines)
 Lines 103-109    Link Here 
103
import org.openide.filesystems.FileChangeAdapter;
103
import org.openide.filesystems.FileChangeAdapter;
104
import org.openide.filesystems.FileEvent;
104
import org.openide.filesystems.FileEvent;
105
import org.openide.filesystems.FileObject;
105
import org.openide.filesystems.FileObject;
106
import org.openide.filesystems.FileStateInvalidException;
107
import org.openide.filesystems.FileUtil;
106
import org.openide.filesystems.FileUtil;
108
import org.openide.filesystems.URLMapper;
107
import org.openide.filesystems.URLMapper;
109
import org.openide.loaders.DataObject;
108
import org.openide.loaders.DataObject;
 Lines 399-413    Link Here 
399
                for (Project p : toOpenProjects) {
398
                for (Project p : toOpenProjects) {
400
                    INSTANCE.addModuleInfo(p);
399
                    INSTANCE.addModuleInfo(p);
401
                    // Set main project
400
                    // Set main project
402
                    try {
403
                        if ( mainProjectURL != null && 
401
                        if ( mainProjectURL != null && 
404
                             mainProjectURL.equals( p.getProjectDirectory().getURL() ) ) {
402
                             mainProjectURL.equals( p.getProjectDirectory().toURL() ) ) {
405
                            lazyMainProject = p;
403
                            lazyMainProject = p;
406
                        }
404
                        }
407
                    }
408
                    catch( FileStateInvalidException e ) {
409
                        // Not a main project
410
                    }
411
                }
405
                }
412
                return toOpenProjects.size();
406
                return toOpenProjects.size();
413
                }
407
                }
 Lines 1115-1129    Link Here 
1115
    private static List<URL> projects2URLs( Collection<Project> projects ) {
1109
    private static List<URL> projects2URLs( Collection<Project> projects ) {
1116
        ArrayList<URL> URLs = new ArrayList<URL>( projects.size() );
1110
        ArrayList<URL> URLs = new ArrayList<URL>( projects.size() );
1117
        for(Project p: projects) {
1111
        for(Project p: projects) {
1118
            try {
1112
                URL root = p.getProjectDirectory().toURL();
1119
                URL root = p.getProjectDirectory().getURL();
1120
                if ( root != null ) {
1113
                if ( root != null ) {
1121
                    URLs.add( root );
1114
                    URLs.add( root );
1122
                }
1115
                }
1123
            }
1124
            catch( FileStateInvalidException e ) {
1125
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
1126
            }
1127
        }        
1116
        }        
1128
        
1117
        
1129
        return URLs;
1118
        return URLs;
 Lines 1263-1275    Link Here 
1263
    }
1252
    }
1264
    
1253
    
1265
    private static void saveMainProject( Project mainProject ) {        
1254
    private static void saveMainProject( Project mainProject ) {        
1266
        try {
1255
            URL mainRoot = mainProject == null ? null : mainProject.getProjectDirectory().toURL();
1267
            URL mainRoot = mainProject == null ? null : mainProject.getProjectDirectory().getURL(); 
1268
            OpenProjectListSettings.getInstance().setMainProjectURL( mainRoot );
1256
            OpenProjectListSettings.getInstance().setMainProjectURL( mainRoot );
1269
        }
1270
        catch ( FileStateInvalidException e ) {
1271
            OpenProjectListSettings.getInstance().setMainProjectURL((String) null);
1272
        }
1273
    }
1257
    }
1274
        
1258
        
1275
    private ArrayList<FileObject> getTemplateNamesLRU( final Project project, PrivilegedTemplates priv ) {
1259
    private ArrayList<FileObject> getTemplateNamesLRU( final Project project, PrivilegedTemplates priv ) {
 Lines 1391-1405    Link Here 
1391
        
1375
        
1392
        public void add(final Project p) {
1376
        public void add(final Project p) {
1393
            final UnloadedProjectInformation projectInfo;
1377
            final UnloadedProjectInformation projectInfo;
1394
            try { // #183681: call outside of lock
1378
            // #183681: call outside of lock
1395
                projectInfo = ProjectInfoAccessor.DEFAULT.getProjectInfo(
1379
                projectInfo = ProjectInfoAccessor.DEFAULT.getProjectInfo(
1396
                        ProjectUtils.getInformation(p).getDisplayName(),
1380
                        ProjectUtils.getInformation(p).getDisplayName(),
1397
                        ProjectUtils.getInformation(p).getIcon(),
1381
                        ProjectUtils.getInformation(p).getIcon(),
1398
                        p.getProjectDirectory().getURL());
1382
                        p.getProjectDirectory().toURL());
1399
            } catch(FileStateInvalidException ex) {
1400
                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
1401
                return;
1402
            }
1403
            ProjectManager.mutex().writeAccess(new Mutex.Action<Void>() {
1383
            ProjectManager.mutex().writeAccess(new Mutex.Action<Void>() {
1404
                public @Override Void run() {
1384
                public @Override Void run() {
1405
                int index = getIndex(p);
1385
                int index = getIndex(p);
 Lines 1576-1592    Link Here 
1576
        }
1556
        }
1577
        
1557
        
1578
        private int getIndex( Project p ) {
1558
        private int getIndex( Project p ) {
1579
            
1559
            if (p == null || p.getProjectDirectory() == null) {
1580
            URL pURL;
1581
            try {
1582
                if ( p == null || p.getProjectDirectory() == null ) {
1583
                    return -1;
1584
                }
1585
                pURL = p.getProjectDirectory().getURL();                
1586
            }
1587
            catch( FileStateInvalidException e ) {
1588
                return -1;
1560
                return -1;
1589
            }
1561
            }
1562
            URL pURL = p.getProjectDirectory().toURL();
1590
            
1563
            
1591
            int i = 0;
1564
            int i = 0;
1592
            
1565
            
 Lines 1623-1636    Link Here 
1623
            
1596
            
1624
            public ProjectReference( Project p ) {
1597
            public ProjectReference( Project p ) {
1625
                this.projectReference = new WeakReference<Project>( p );
1598
                this.projectReference = new WeakReference<Project>( p );
1626
                try {
1599
                projectURL = p.getProjectDirectory().toURL();
1627
                    projectURL = p.getProjectDirectory().getURL();                
1628
                }
1629
                catch( FileStateInvalidException e ) {
1630
                    if (LOGGER.isLoggable(Level.FINE)) {
1631
                        log(Level.FINE, "FSIE getting URL for project: " + p.getProjectDirectory());
1632
                    }
1633
                }
1634
            }
1600
            }
1635
            
1601
            
1636
            public Project getProject() {
1602
            public Project getProject() {
(-)a/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java (-11 / +1 lines)
 Lines 71-77    Link Here 
71
import org.openide.cookies.EditCookie;
71
import org.openide.cookies.EditCookie;
72
import org.openide.cookies.OpenCookie;
72
import org.openide.cookies.OpenCookie;
73
import org.openide.filesystems.FileObject;
73
import org.openide.filesystems.FileObject;
74
import org.openide.filesystems.FileStateInvalidException;
75
import org.openide.filesystems.FileUtil;
74
import org.openide.filesystems.FileUtil;
76
import org.openide.filesystems.URLMapper;
75
import org.openide.filesystems.URLMapper;
77
import org.openide.loaders.DataObject;
76
import org.openide.loaders.DataObject;
 Lines 179-194    Link Here 
179
                            // add project
178
                            // add project
180
                            wr.urls4project.put(owner, new LinkedHashSet<String>());
179
                            wr.urls4project.put(owner, new LinkedHashSet<String>());
181
                        }
180
                        }
182
                        URL url = null;
181
                        wr.urls4project.get(owner).add(dobj.getPrimaryFile().toURL().toExternalForm());
183
184
                        try {
185
                            url = dobj.getPrimaryFile().getURL();
186
                            wr.urls4project.get(owner).add(url.toExternalForm());
187
                        }
188
                        catch (FileStateInvalidException fsie) {
189
                            assert false : "FileStateInvalidException in " +
190
                                           dobj.getPrimaryFile();
191
                        }
192
                    }
182
                    }
193
                } else {
183
                } else {
194
                    ERR.log(Level.FINE, "#194243: no DataObject in lookup of {0} of {1}", new Object[] {tc.getName(), tc.getClass()});
184
                    ERR.log(Level.FINE, "#194243: no DataObject in lookup of {0} of {1}", new Object[] {tc.getName(), tc.getClass()});
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/AdHocGroup.java (-6 / +1 lines)
 Lines 57-63    Link Here 
57
import org.netbeans.api.progress.ProgressHandle;
57
import org.netbeans.api.progress.ProgressHandle;
58
import org.netbeans.api.project.Project;
58
import org.netbeans.api.project.Project;
59
import org.netbeans.api.project.ui.OpenProjects;
59
import org.netbeans.api.project.ui.OpenProjects;
60
import org.openide.filesystems.FileStateInvalidException;
61
60
62
/**
61
/**
63
 * Arbitrary collection of projects, with an optional main project.
62
 * Arbitrary collection of projects, with an optional main project.
 Lines 117-127    Link Here 
117
    public void setProjects(Set<Project> projects) {
116
    public void setProjects(Set<Project> projects) {
118
        Set<String> projectPaths = new TreeSet<String>();
117
        Set<String> projectPaths = new TreeSet<String>();
119
        for (Project prj : projects) {
118
        for (Project prj : projects) {
120
            try {
119
            projectPaths.add(prj.getProjectDirectory().toURL().toExternalForm());
121
                projectPaths.add(prj.getProjectDirectory().getURL().toExternalForm());
122
            } catch (FileStateInvalidException x) {
123
                LOG.log(Level.WARNING, null, x);
124
            }
125
        }
120
        }
126
        prefs().put(KEY_PATH, joinPaths(projectPaths));
121
        prefs().put(KEY_PATH, joinPaths(projectPaths));
127
        LOG.log(Level.FINE, "updating projects for {0} to {1}", new Object[] {id, projects});
122
        LOG.log(Level.FINE, "updating projects for {0} to {1}", new Object[] {id, projects});
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/DirectoryGroup.java (-5 / +2 lines)
 Lines 44-50    Link Here 
44
44
45
package org.netbeans.modules.project.ui.groups;
45
package org.netbeans.modules.project.ui.groups;
46
46
47
import java.io.File;
48
import java.io.IOException;
47
import java.io.IOException;
49
import java.net.MalformedURLException;
48
import java.net.MalformedURLException;
50
import java.net.URL;
49
import java.net.URL;
 Lines 58-65    Link Here 
58
import org.netbeans.api.project.ProjectManager;
57
import org.netbeans.api.project.ProjectManager;
59
import org.netbeans.api.queries.SharabilityQuery;
58
import org.netbeans.api.queries.SharabilityQuery;
60
import org.openide.filesystems.FileObject;
59
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileStateInvalidException;
62
import org.openide.filesystems.FileUtil;
63
import org.openide.filesystems.URLMapper;
60
import org.openide.filesystems.URLMapper;
64
import org.openide.util.Exceptions;
61
import org.openide.util.Exceptions;
65
62
 Lines 76-83    Link Here 
76
    /**
73
    /**
77
     * Create a new group derived from a directory.
74
     * Create a new group derived from a directory.
78
     */
75
     */
79
    public static DirectoryGroup create(String name, FileObject dir) throws FileStateInvalidException {
76
    public static DirectoryGroup create(String name, FileObject dir) {
80
        String path = dir.getURL().toExternalForm();
77
        String path = dir.toURL().toExternalForm();
81
        String id = sanitizeNameAndUniquifyForId(name);
78
        String id = sanitizeNameAndUniquifyForId(name);
82
        LOG.log(Level.FINE, "Creating: {0}", id);
79
        LOG.log(Level.FINE, "Creating: {0}", id);
83
        Preferences p = NODE.node(id);
80
        Preferences p = NODE.node(id);
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/Group.java (-11 / +2 lines)
 Lines 76-82    Link Here 
76
import org.netbeans.modules.project.ui.ProjectUtilities;
76
import org.netbeans.modules.project.ui.ProjectUtilities;
77
import static org.netbeans.modules.project.ui.groups.Bundle.*;
77
import static org.netbeans.modules.project.ui.groups.Bundle.*;
78
import org.openide.filesystems.FileObject;
78
import org.openide.filesystems.FileObject;
79
import org.openide.filesystems.FileStateInvalidException;
80
import org.openide.filesystems.URLMapper;
79
import org.openide.filesystems.URLMapper;
81
import org.openide.util.Exceptions;
80
import org.openide.util.Exceptions;
82
import org.openide.util.NbBundle;
81
import org.openide.util.NbBundle;
 Lines 325-335    Link Here 
325
    protected List<String> projectPaths() {
324
    protected List<String> projectPaths() {
326
        List<String> urls = new ArrayList<String>();
325
        List<String> urls = new ArrayList<String>();
327
        for (Project p : getProjects()) {
326
        for (Project p : getProjects()) {
328
            try {
327
            urls.add(p.getProjectDirectory().toURL().toString());
329
                urls.add(p.getProjectDirectory().getURL().toString());
330
            } catch (FileStateInvalidException x) {
331
                Exceptions.printStackTrace(x);
332
            }
333
        }
328
        }
334
        return urls;
329
        return urls;
335
    }
330
    }
 Lines 354-364    Link Here 
354
        LOG.log(Level.FINE, "updating main project for {0} to {1}", new Object[] {id, mainProject});
349
        LOG.log(Level.FINE, "updating main project for {0} to {1}", new Object[] {id, mainProject});
355
        URL f = null;
350
        URL f = null;
356
        if (mainProject != null && getProjects().contains(mainProject)) {
351
        if (mainProject != null && getProjects().contains(mainProject)) {
357
            try {
352
            f = mainProject.getProjectDirectory().toURL();
358
                f = mainProject.getProjectDirectory().getURL();
359
            } catch (FileStateInvalidException x) {
360
                LOG.log(Level.WARNING, null, x);
361
            }
362
        }
353
        }
363
        if (f != null) {
354
        if (f != null) {
364
            prefs().put(KEY_MAIN, f.toExternalForm());
355
            prefs().put(KEY_MAIN, f.toExternalForm());
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/NewGroupPanel.java (-6 / +1 lines)
 Lines 60-66    Link Here 
60
import org.netbeans.spi.project.ui.support.ProjectChooser;
60
import org.netbeans.spi.project.ui.support.ProjectChooser;
61
import org.openide.NotificationLineSupport;
61
import org.openide.NotificationLineSupport;
62
import org.openide.filesystems.FileObject;
62
import org.openide.filesystems.FileObject;
63
import org.openide.filesystems.FileStateInvalidException;
64
import org.openide.filesystems.FileUtil;
63
import org.openide.filesystems.FileUtil;
65
import org.openide.util.Exceptions;
64
import org.openide.util.Exceptions;
66
import org.openide.util.NbBundle.Messages;
65
import org.openide.util.NbBundle.Messages;
 Lines 171-181    Link Here 
171
        } else {
170
        } else {
172
            assert directoryKindRadio.isSelected();
171
            assert directoryKindRadio.isSelected();
173
            FileObject f = FileUtil.toFileObject(FileUtil.normalizeFile(new File(directoryField.getText().trim())));
172
            FileObject f = FileUtil.toFileObject(FileUtil.normalizeFile(new File(directoryField.getText().trim())));
174
            try {
173
            return DirectoryGroup.create(nameField.getText().trim(), f);
175
                return DirectoryGroup.create(nameField.getText().trim(), f);
176
            } catch (FileStateInvalidException x) {
177
                throw new AssertionError(x);
178
            }
179
        }
174
        }
180
    }
175
    }
181
176
(-)a/projectui/src/org/netbeans/modules/project/ui/groups/SubprojectsGroup.java (-3 / +2 lines)
 Lines 55-61    Link Here 
55
import org.netbeans.api.project.ProjectUtils;
55
import org.netbeans.api.project.ProjectUtils;
56
import org.netbeans.spi.project.SubprojectProvider;
56
import org.netbeans.spi.project.SubprojectProvider;
57
import org.openide.filesystems.FileObject;
57
import org.openide.filesystems.FileObject;
58
import org.openide.filesystems.FileStateInvalidException;
59
import org.openide.filesystems.URLMapper;
58
import org.openide.filesystems.URLMapper;
60
59
61
/**
60
/**
 Lines 74-81    Link Here 
74
     * but this could be changed later.
73
     * but this could be changed later.
75
     * The display name is by default that of the superproject.
74
     * The display name is by default that of the superproject.
76
     */
75
     */
77
    public static SubprojectsGroup create(String name, Project project) throws FileStateInvalidException {
76
    public static SubprojectsGroup create(String name, Project project) {
78
        String path = project.getProjectDirectory().getURL().toExternalForm();
77
        String path = project.getProjectDirectory().toURL().toExternalForm();
79
        String id = sanitizeNameAndUniquifyForId(name);
78
        String id = sanitizeNameAndUniquifyForId(name);
80
        LOG.log(Level.FINE, "Creating: {0}", id);
79
        LOG.log(Level.FINE, "Creating: {0}", id);
81
        Preferences p = NODE.node(id);
80
        Preferences p = NODE.node(id);
(-)a/projectui/test/unit/src/org/netbeans/modules/project/ui/OpenProjectListTest.java (-22 / +17 lines)
 Lines 72-78    Link Here 
72
import org.netbeans.spi.project.SubprojectProvider;
72
import org.netbeans.spi.project.SubprojectProvider;
73
import org.netbeans.spi.project.ui.ProjectOpenedHook;
73
import org.netbeans.spi.project.ui.ProjectOpenedHook;
74
import org.openide.filesystems.FileObject;
74
import org.openide.filesystems.FileObject;
75
import org.openide.filesystems.FileStateInvalidException;
76
import org.openide.filesystems.FileUtil;
75
import org.openide.filesystems.FileUtil;
77
import org.openide.filesystems.URLMapper;
76
import org.openide.filesystems.URLMapper;
78
import org.openide.loaders.DataObject;
77
import org.openide.loaders.DataObject;
 Lines 144-151    Link Here 
144
            fail("There should be TestProject\n" + log.toString());
143
            fail("There should be TestProject\n" + log.toString());
145
        }
144
        }
146
        
145
        
147
        assertTrue ("Document f1_1_open is loaded.", handler.openFiles.contains (f1_1_open.getURL ().toExternalForm ()));
146
        assertTrue ("Document f1_1_open is loaded.", handler.openFiles.contains (f1_1_open.toURL ().toExternalForm ()));
148
        assertTrue ("Document f1_2_open is loaded.", handler.openFiles.contains (f1_2_open.getURL ().toExternalForm ()));
147
        assertTrue ("Document f1_2_open is loaded.", handler.openFiles.contains (f1_2_open.toURL ().toExternalForm ()));
149
        /* XXX always fails; what was this testing?
148
        /* XXX always fails; what was this testing?
150
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
149
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
151
        */
150
        */
 Lines 186-193    Link Here 
186
        if (!m.find()) {
185
        if (!m.find()) {
187
            fail("There should be TestProject\n" + log);
186
            fail("There should be TestProject\n" + log);
188
        }
187
        }
189
        assertFalse ("Document f1_1_open isn't loaded.", handler.openFiles.contains (f1_1_open.getURL ().toExternalForm ()));
188
        assertFalse ("Document f1_1_open isn't loaded.", handler.openFiles.contains (f1_1_open.toURL ().toExternalForm ()));
190
        assertFalse ("Document f1_2_open isn't loaded.", handler.openFiles.contains (f1_2_open.getURL ().toExternalForm ()));
189
        assertFalse ("Document f1_2_open isn't loaded.", handler.openFiles.contains (f1_2_open.toURL ().toExternalForm ()));
191
        /* XXX fails, see above
190
        /* XXX fails, see above
192
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
191
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
193
        */
192
        */
 Lines 196-211    Link Here 
196
        OpenProjectList.getDefault ().open (project2);
195
        OpenProjectList.getDefault ().open (project2);
197
        
196
        
198
        // close all project1's documents
197
        // close all project1's documents
199
        handler.openFiles.remove (f1_1_open.getURL ().toExternalForm ());
198
        handler.openFiles.remove (f1_1_open.toURL ().toExternalForm ());
200
        handler.openFiles.remove (f1_2_open.getURL ().toExternalForm ());
199
        handler.openFiles.remove (f1_2_open.toURL ().toExternalForm ());
201
        
200
        
202
        ProjectUtilities.closeAllDocuments(new Project[] {project1}, false);
201
        ProjectUtilities.closeAllDocuments(new Project[] {project1}, false);
203
        OpenProjectList.getDefault().close(new Project[] {project1}, false);
202
        OpenProjectList.getDefault().close(new Project[] {project1}, false);
204
203
205
        OpenProjectList.getDefault ().open (project1);
204
        OpenProjectList.getDefault ().open (project1);
206
        assertFalse ("Document f1_1_open isn't loaded.", handler.openFiles.contains (f1_1_open.getURL ().toExternalForm ()));
205
        assertFalse ("Document f1_1_open isn't loaded.", handler.openFiles.contains (f1_1_open.toURL ().toExternalForm ()));
207
        assertFalse ("Document f1_2_open isn't loaded.", handler.openFiles.contains (f1_2_open.getURL ().toExternalForm ()));
206
        assertFalse ("Document f1_2_open isn't loaded.", handler.openFiles.contains (f1_2_open.toURL ().toExternalForm ()));
208
        assertTrue ("Document f2_1_open is still loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
207
        assertTrue ("Document f2_1_open is still loaded.", handler.openFiles.contains (f2_1_open.toURL ().toExternalForm ()));
209
    }
208
    }
210
209
211
    public void testSerialize() throws Exception {
210
    public void testSerialize() throws Exception {
 Lines 242-250    Link Here 
242
            fail("There should be TestProject\n" + log);
241
            fail("There should be TestProject\n" + log);
243
        }
242
        }
244
        
243
        
245
        assertTrue ("Document f1_1_open is loaded.", handler.openFiles.contains (f1_1_open.getURL ().toExternalForm ()));
244
        assertTrue ("Document f1_1_open is loaded.", handler.openFiles.contains (f1_1_open.toURL ().toExternalForm ()));
246
        assertTrue ("Document f1_2_open is loaded.", handler.openFiles.contains (f1_2_open.getURL ().toExternalForm ()));
245
        assertTrue ("Document f1_2_open is loaded.", handler.openFiles.contains (f1_2_open.toURL ().toExternalForm ()));
247
        assertTrue ("Document f2_1_open is loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
246
        assertTrue ("Document f2_1_open is loaded.", handler.openFiles.contains (f2_1_open.toURL ().toExternalForm ()));
248
    }
247
    }
249
    
248
    
250
    public void testCloseProjectWithoutOpenDocuments () throws Exception {
249
    public void testCloseProjectWithoutOpenDocuments () throws Exception {
 Lines 253-261    Link Here 
253
        assertFalse ("Project1 isn't opened.", OpenProjectList.getDefault ().isOpen (project1));
252
        assertFalse ("Project1 isn't opened.", OpenProjectList.getDefault ().isOpen (project1));
254
        assertTrue ("Project2 is opened.", OpenProjectList.getDefault ().isOpen (project2));
253
        assertTrue ("Project2 is opened.", OpenProjectList.getDefault ().isOpen (project2));
255
        
254
        
256
        handler.openFiles.remove (f2_1_open.getURL ().toExternalForm ());
255
        handler.openFiles.remove (f2_1_open.toURL ().toExternalForm ());
257
        
256
        
258
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.getURL ().toExternalForm ()));
257
        assertFalse ("Document f2_1_open isn't loaded.", handler.openFiles.contains (f2_1_open.toURL ().toExternalForm ()));
259
        
258
        
260
        ProjectUtilities.closeAllDocuments(new Project[] {project2}, false);
259
        ProjectUtilities.closeAllDocuments(new Project[] {project2}, false);
261
        OpenProjectList.getDefault().close(new Project[] {project2}, false);
260
        OpenProjectList.getDefault().close(new Project[] {project2}, false);
 Lines 398-408    Link Here 
398
            DataObject dobj = null;
397
            DataObject dobj = null;
399
            try {
398
            try {
400
                dobj = DataObject.find (fo);
399
                dobj = DataObject.find (fo);
401
                url = dobj.getPrimaryFile ().getURL ();
400
                url = dobj.getPrimaryFile ().toURL ();
402
                urls4project.get(owner).add(url.toExternalForm());
401
                urls4project.get(owner).add(url.toExternalForm());
403
                openFiles.add (fo.getURL ().toExternalForm ());
402
                openFiles.add (fo.toURL ().toExternalForm ());
404
            } catch (FileStateInvalidException fsie) {
405
                fail ("FileStateInvalidException in " + dobj.getPrimaryFile ());
406
            } catch (DataObjectNotFoundException donfe) {
403
            } catch (DataObjectNotFoundException donfe) {
407
                fail ("DataObjectNotFoundException on " + fo);
404
                fail ("DataObjectNotFoundException on " + fo);
408
            }
405
            }
 Lines 420-430    Link Here 
420
                        FileObject fo = null;
417
                        FileObject fo = null;
421
                        try {
418
                        try {
422
                            fo = URLMapper.findFileObject (new URL (url));
419
                            fo = URLMapper.findFileObject (new URL (url));
423
                            openFiles.remove (fo.getURL ().toExternalForm ());
420
                            openFiles.remove (fo.toURL ().toExternalForm ());
424
                        } catch (MalformedURLException mue) {
421
                        } catch (MalformedURLException mue) {
425
                            fail ("MalformedURLException in " + url);
422
                            fail ("MalformedURLException in " + url);
426
                        } catch (FileStateInvalidException fsie) {
427
                            fail ("FileStateInvalidException in " + fo);
428
                        }
423
                        }
429
                    }
424
                    }
430
                }
425
                }
(-)a/projectui/test/unit/src/org/netbeans/modules/project/ui/ProjectsRootNodeTest.java (-1 / +1 lines)
 Lines 412-418    Link Here 
412
            public @Override void addChangeListener(ChangeListener listener) {}
412
            public @Override void addChangeListener(ChangeListener listener) {}
413
            public @Override void removeChangeListener(ChangeListener listener) {}
413
            public @Override void removeChangeListener(ChangeListener listener) {}
414
        }));
414
        }));
415
        final LazyProject lp = new LazyProject(d.getURL(), "p", new ExtIcon());
415
        final LazyProject lp = new LazyProject(d.toURL(), "p", new ExtIcon());
416
        Children ch = new ProjectsRootNode.ProjectChildren(ProjectsRootNode.PHYSICAL_VIEW) {
416
        Children ch = new ProjectsRootNode.ProjectChildren(ProjectsRootNode.PHYSICAL_VIEW) {
417
            public @Override void addNotify() {
417
            public @Override void addNotify() {
418
                setKeys(Collections.singleton(new ProjectsRootNode.ProjectChildren.Pair(lp)));
418
                setKeys(Collections.singleton(new ProjectsRootNode.ProjectChildren.Pair(lp)));
(-)a/projectui/test/unit/src/org/netbeans/modules/project/ui/api/RecentProjectsTest.java (-1 / +1 lines)
 Lines 89-95    Link Here 
89
            tp.setLookup(Lookups.fixed(new TestProjectInfo(prjName)));
89
            tp.setLookup(Lookups.fixed(new TestProjectInfo(prjName)));
90
            testProjects[i] = tp;
90
            testProjects[i] = tp;
91
            tpDisplayNames[i] = ProjectUtils.getInformation(tp).getDisplayName();
91
            tpDisplayNames[i] = ProjectUtils.getInformation(tp).getDisplayName();
92
            tpURLs[i] = tp.getProjectDirectory().getURL();
92
            tpURLs[i] = tp.getProjectDirectory().toURL();
93
        }
93
        }
94
    }
94
    }
95
95
(-)a/queries/nbproject/project.xml (-1 / +1 lines)
 Lines 54-60    Link Here 
54
                    <build-prerequisite/>
54
                    <build-prerequisite/>
55
                    <compile-dependency/>
55
                    <compile-dependency/>
56
                    <run-dependency>
56
                    <run-dependency>
57
                        <specification-version>7.19</specification-version>
57
                        <specification-version>7.57</specification-version>
58
                    </run-dependency>
58
                    </run-dependency>
59
                </dependency>
59
                </dependency>
60
                <dependency>
60
                <dependency>
(-)a/queries/src/org/netbeans/api/queries/SharabilityQuery.java (-11 / +1 lines)
 Lines 46-57    Link Here 
46
46
47
import java.io.File;
47
import java.io.File;
48
import java.net.URI;
48
import java.net.URI;
49
import java.net.URISyntaxException;
50
import java.util.logging.Level;
51
import java.util.logging.Logger;
49
import java.util.logging.Logger;
52
import org.netbeans.spi.queries.SharabilityQueryImplementation2;
50
import org.netbeans.spi.queries.SharabilityQueryImplementation2;
53
import org.openide.filesystems.FileObject;
51
import org.openide.filesystems.FileObject;
54
import org.openide.filesystems.FileStateInvalidException;
55
import org.openide.filesystems.FileUtil;
52
import org.openide.filesystems.FileUtil;
56
import org.openide.util.Lookup;
53
import org.openide.util.Lookup;
57
import org.openide.util.Parameters;
54
import org.openide.util.Parameters;
 Lines 232-244    Link Here 
232
     * @since 1.27
229
     * @since 1.27
233
     */
230
     */
234
    public static Sharability getSharability(FileObject fo) {
231
    public static Sharability getSharability(FileObject fo) {
235
        try {
232
        return getSharability(fo.toURI());
236
            return getSharability(fo.getURL().toURI());
237
        } catch (URISyntaxException ex) {
238
            LOG.log(Level.FINE, null, ex);
239
        } catch (FileStateInvalidException ex) {
240
            LOG.log(Level.FINE, null, ex);
241
        }
242
        return Sharability.UNKNOWN;
243
    }
233
    }
244
}
234
}

Return to bug 207294
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo