Index: freeform/src/org/netbeans/modules/ant/freeform/FreeformSources.java =================================================================== RCS file: /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformSources.java,v retrieving revision 1.7 diff -u -r1.7 FreeformSources.java --- freeform/src/org/netbeans/modules/ant/freeform/FreeformSources.java 7 Dec 2004 13:46:11 -0000 1.7 +++ freeform/src/org/netbeans/modules/ant/freeform/FreeformSources.java 16 May 2005 13:54:08 -0000 @@ -85,6 +85,23 @@ } } } + + //Fix for #57656: + List/**/ genldataChildren = Util.findSubElements(genldata); + + Iterator it = genldataChildren.iterator(); + + while (it.hasNext()) { + Element possibleExport = (Element ) it.next(); + + if ("export".equals(possibleExport.getLocalName()) && FreeformProjectType.NS_GENERAL.equals(possibleExport.getNamespaceURI())) { + Element locationE = Util.findElement(possibleExport, "location", FreeformProjectType.NS_GENERAL); + String location = Util.findText(locationE); + + h.addNonSourceRoot(location); + } + } + ProjectManager.mutex().postWriteRequest(new Runnable() { public void run() { h.registerExternalRoots(FileOwnerQuery.EXTERNAL_ALGORITHM_TRANSIENT); Index: project/src/org/netbeans/spi/project/support/ant/SourcesHelper.java =================================================================== RCS file: /cvs/ant/project/src/org/netbeans/spi/project/support/ant/SourcesHelper.java,v retrieving revision 1.11 diff -u -r1.11 SourcesHelper.java --- project/src/org/netbeans/spi/project/support/ant/SourcesHelper.java 26 Oct 2004 13:58:51 -0000 1.11 +++ project/src/org/netbeans/spi/project/support/ant/SourcesHelper.java 16 May 2005 13:54:08 -0000 @@ -17,6 +17,7 @@ import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; +import java.net.URI; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -266,35 +267,32 @@ while (it.hasNext()) { Root r = (Root)it.next(); File locF = r.getActualLocation(); + URI uri = locF.toURI(); FileObject loc = locF != null ? FileUtil.toFileObject(locF) : null; - if (loc == null) { - // Not there; skip it. - continue; - } - if (!loc.isFolder()) { - // Actually a file. Skip it. - continue; - } - if (FileUtil.getRelativePath(pdir, loc) != null) { - // Inside projdir already. Skip it. - continue; - } - try { - Project other = ProjectManager.getDefault().findProject(loc); - if (other != null) { - // This is a foreign project; we cannot own it. Skip it. + if (loc != null) { + if (FileUtil.getRelativePath(pdir, loc) != null) { + // Inside projdir already. Skip it. + continue; + } + try { + if (loc.isFolder()) { + Project other = ProjectManager.getDefault().findProject(loc); + if (other != null) { + // This is a foreign project; we cannot own it. Skip it. + continue; + } + } + } catch (IOException e) { + // Assume it is a foreign project and skip it. continue; } - } catch (IOException e) { - // Assume it is a foreign project and skip it. - continue; } // It's OK to go. if (newRootsToRegister != null) { - newRootsToRegister.add(loc); + newRootsToRegister.add(uri); } else { - lastRegisteredRoots.add(loc); - FileOwnerQuery.markExternalOwner(loc, p, registeredRootAlgorithm); + lastRegisteredRoots.add(uri); + FileOwnerQuery.markExternalOwner(uri, p, registeredRootAlgorithm); } } if (newRootsToRegister != null) { @@ -303,13 +301,13 @@ toUnregister.removeAll(newRootsToRegister); Iterator rootIt = toUnregister.iterator(); while (rootIt.hasNext()) { - FileObject loc = (FileObject)rootIt.next(); + URI loc = (URI)rootIt.next(); FileOwnerQuery.markExternalOwner(loc, null, registeredRootAlgorithm); } newRootsToRegister.removeAll(lastRegisteredRoots); rootIt = newRootsToRegister.iterator(); while (rootIt.hasNext()) { - FileObject loc = (FileObject)rootIt.next(); + URI loc = (URI)rootIt.next(); FileOwnerQuery.markExternalOwner(loc, p, registeredRootAlgorithm); } }