[xml-dev] GrammarManager.getGrammar

Rich Unger <[email protected]> Fri, 29 Nov 2002 15:27:26 -0800
Newsgroups gmane.comp.java.netbeans.modules.xml.devel
Organization CollabNet Hosting
Message-ID <[email protected]>
Petr, the line you added to GrammarManager.getGrammar:

if (d == null) throw new IllegalArgumentException("null");

Seems to be throwing the exception when a file is first opened.  Could
this be the key to the poor performance?

BTW, when I replaced it with a silent failure:

if (d == null ) return null

and checked for nulls whenever I call getGrammar(), it worked fine.  I
didn't check it in, though, because I think your code is better, and
just returning null is covering up some other problem.

All the getGrammar() requests come from ElementNode (or stuff called
by ElementNode).  If there is some laziness in binding the ElementNode
to its owner DataObject, how can we force the binding when asking for
a grammar?

Rich