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.
when evaluating issue 145015, I've noticed that the GrammarManager in xml.edit seems to create 2 GrammarQuery instances for one file, one is mostly very quickly garbage collected. One reason why it happens is the not initialized environmentElementsCount variable that on document edit triggers a reload. There might be more, but it seems to be connected with the initialization routine as I've always got exactly 2 instances of my GrammarQuery for the fiven file. Filing as P3 issue as the GrammarQuery for maven support performs a rather costly operation on completion query and needs to cache the values, having multiple instances that do caching is bad though.
Can you explain your claim so that I can verify. I debugged using a struts-config.xml and I see only one instance. How/when are you seeing two?
I've added a System.out in this classes constructor, http://hg.netbeans.org/main/file/84096919e4bf/maven.grammar/src/org/netbeans/modules/maven/grammar/MavenProjectGrammar.java and also generated a finalize() method with System.out When completing a text value in any given pom.xml file eg. <version>!HERE</version> the debug output shows 2 instance being created. One seems to be pretty fast GCed again. a pom.xml file is created with creating a new maven project (or opening any existing maven project for that matter)
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.