This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
SH should ensure that if a TYPE_GENERIC group has a subfolder which is in nonSourceRoots, it is not marked as contain()'d. This would permit you to add a <build-folder> to a freeform project which could make that subfolder be excluded from searches etc.
Alternately: keep a static Set<File> of nonSourceRoots (from all SH instances), and install a global SharabilityQueryImplementation which reports these dirs (and any children) as NOT_SHARABLE. This would have the effect of making such dirs not be contain()'d in generic groups, but be more general.
Test in nbbuild/nbproject/project.xml with Go to File: <build-folder> <location>build</location> </build-folder> <build-folder> <location>nbms</location> </build-folder> <build-folder> <location>netbeans</location> </build-folder> <build-folder> <location>testuserdir</location> </build-folder>
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss