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.

Bug 145405 - multiple instances of GrammarQuery created.
Summary: multiple instances of GrammarQuery created.
Status: RESOLVED WONTFIX
Alias: None
Product: xml
Classification: Unclassified
Component: Text-Edit (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks: 145015
  Show dependency tree
 
Reported: 2008-08-28 11:14 UTC by Milos Kleint
Modified: 2015-09-17 13:17 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Kleint 2008-08-28 11:14:51 UTC
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.
Comment 1 Samaresh Panda 2008-09-05 20:08:17 UTC
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?
Comment 2 Milos Kleint 2008-09-08 12:18:40 UTC
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)

Comment 3 Martin Balin 2015-09-17 13:17:07 UTC
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.