matthiasblaesing opened a new issue, #6881:
URL: https://github.com/apache/netbeans/issues/6881
### Body
I noticed, that when I created a `test.java` file in my `tmp` directory,
NetBeans suddenly started a massive scanning job. It turned out NetBeans
scanned the whole folder, which also included an angular project with ~30.000
files in the `node_modules` folder. What is more, I noticed, that other
projects in the folder were marked as broken.
My gut feeling led me to the changes for the mult-file source launcher and
indeed it has problematic side effect. I could reproduce it like this:
0. Checkout babcc3d5c1c4c454a0e9fbcad99e0500896f07d6 (current master), clean
dir and build NB and run with "ant tryme"
1. Create an empty directory (PATH in the following)
2. Inside the new directory create a new maven project ("Java with Maven ->
Java Application", with default settings, just parent folder changed to PATH)
3. Add `gson` to the `pom.xml` (as child element of the `project` node):
```xml
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
</dependencies>
```
5. Ensure dependency is locally present by invoking "Download Declared
Dependencies" on the "Dependencies" node
6. Change class Mavenproject1 to:
```java
package test.mavenproject1;
import com.google.gson.Gson;
import java.util.Collections;
public class Mavenproject1 {
public static void main(String[] args) {
new Gson().toJson(Collections.singletonMap("Hello", "World"));
}
}
```
8. Open Favorites tab and create test.java in the directory created in step 1
**Mavenproject1.java is immediately marked as "has errors**
9. Open "Window -> Action Items" and open `Mavenproject1.java`
**You'll see:**
```
Error Package com.google.gson ist nicht vorhanden
Mavenproject1.java
PATH/mavenproject1/src/main/java/test/mavenproject1/Mavenproject1.java:3
Error Symbol nicht gefunden Symbol: Klasse Gson Ort: Klasse
test.mavenproject1.Mavenproject1 Mavenproject1.java
PATH/mavenproject1/src/main/java/test/mavenproject1/Mavenproject1.java:9
```
10. Remove the directory
11. Revert multi-file launcher:
```bash
git revert 192bb526a9f535485905998674460c1aaafb9b20
git rm
java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/SharedRootData.java
java/java.file.launcher/src/org/netbeans/modules/java/file/launcher/queries/MultiSourceRootProvider.java
git revert --continue
```
13. Build again with `git clean -f -x -d; ant`
14. Run with `ant try`
15. Repeat steps 2-7 and observe, that problems are gone
### Committer
- [X] I acknowledge that I am a maintainer/committer in the Apache NetBeans
project.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists