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.
Build: NetBeans IDE Dev (Build 100415-eade64a5bc80) VM: OpenJDK Client VM, 14.0-b08, OpenJDK Runtime Environment, 1.6.0_0-b14 OS: Linux Stacktrace: java.lang.NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.reCountLanguages(MakeConfiguration.java:663) at org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider.recordMetricsImpl(ConfigurationDescriptorProvider.java:292) at org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider.recordMetrics(ConfigurationDescriptorProvider.java:188) at org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader._read(ConfigurationXMLReader.java:219) at org.netbeans.modules.cnd.makeproject.configurations.ConfigurationXMLReader$1.runImpl(ConfigurationXMLReader.java:121) at org.netbeans.modules.cnd.utils.NamedRunnable.run(NamedRunnable.java:59)
Created attachment 97431 [details] stacktrace
OK, here is what I think is going on: There is now a race condition when opening a unmanaged project and there are (many) files listed in the descriptor that no longer exists on disk. During reading the project, attachListeners() is called and it is now executed in it's own thread. In addition to attaching listeners, it also checks whether files exists or not and removes them from MakeConfigurationDescriptor.projectitems if they don't. And here is the race condition: we may get to reCountLanguages while items are being removed from projectitems from attachListeners(). There are many different fixes. Running attachListeners() in it's own thread is dangerous for the above reason so I just enabled the wait statement at the bottom of the function so it runs in sequeltial. This is how the code was originally written (sort of) and should fix the race condition. Will close as Fixed. It is however desirable to run attachListeners in parallel but it requires a (slightly) different approach. Will ask Alexander if he can come up with a safe solution for this.
Integrated into 'main-golden', will be available in build *201004170515* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/3714851b2e54 User: Thomas Preisler <thp@netbeans.org> Log: #184260 - NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.reCountLanguages
This solution increases opening time of huge projects. We should invent another solution. Please revert modifications.
changes was reverted
fixed, change set: http://hg.netbeans.org/cnd-main/rev/6de9babb9967
Integrated into 'main-golden', will be available in build *201004210200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/6de9babb9967 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed BZ#184260 NullPointerException at org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration.reCountLanguages