--- a/project.ant/src/org/netbeans/spi/project/support/ant/SourcesHelper.java +++ a/project.ant/src/org/netbeans/spi/project/support/ant/SourcesHelper.java @@ -711,8 +711,7 @@ * Register all external source or non-source roots using {@link FileOwnerQuery#markExternalOwner}. *
* Only roots added by {@link #addPrincipalSourceRoot} and {@link #addNonSourceRoot} - * are considered. They are registered if (and only if) they in fact fall - * outside of the project directory, and of course only if the folders really + * are considered. They are registered only if the folders really * exist on disk. Currently it is not defined when this file existence check * is done (e.g. when this method is first called, or periodically) or whether * folders which are created subsequently will be registered, so project type @@ -761,8 +760,7 @@ * Register all external source or non-source roots using {@link FileOwnerQuery#markExternalOwner}. *
* Only roots added by {@link #addPrincipalSourceRoot} and {@link #addNonSourceRoot}
- * are considered. They are registered if (and only if) they in fact fall
- * outside of the project directory, and of course only if the folders really
+ * are considered. They are registered only if the folders really
* exist on disk. Currently it is not defined when this file existence check
* is done (e.g. when this method is first called, or periodically) or whether
* folders which are created subsequently will be registered, so project type
@@ -836,14 +834,10 @@
// up calling APH.resolveFileObject repeatedly (for each property change)
for (Root r : allRoots) {
for (FileObject loc : r.getIncludeRoots(minimalSubfolders)) {
- if (FileUtil.getRelativePath(pdir, loc) != null) {
- // Inside projdir already. Skip it.
- continue;
- }
if (loc.isFolder()) {
try {
Project other = ProjectManager.getDefault().findProject(loc);
- if (other != null) {
+ if (other != null && other != p) {
// This is a foreign project; we cannot own it. Skip it.
continue;
}
--- a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java
+++ a/projectapi/src/org/netbeans/modules/projectapi/SimpleFileOwnerQueryImplementation.java
@@ -142,8 +142,9 @@
}
}
+ URI key = fileObject2URI(f);
if (!externalOwners.isEmpty() && (folder || externalRootsIncludeNonFolders)) {
- Reference