The infrastructure for braces matching now calls provided BracesMatcher implementations under the document's lock (ie.
using Document.render()). This may be too restrictive from some implementations. For example when using parser data from
GSF or Java infrastructure.
See issue #131060 for an example, where locking the document causes problems.
The new Parser API might provide some guidelines for dealing with situations like this one.
This issue causes deadlocks in html editor. Please consider this as defect, not enhancement. This really needs to be
fixed in 6.5. Thanks for understanding.
*** Issue 137343 has been marked as a duplicate of this issue. ***
*** Issue 134046 has been marked as a duplicate of this issue. ***
When addressing this issue, please also do not forget about issue 130512 which lists some other problems related to the
bracket matching api.
I am not sure if there is an issue, but as we discussed earlier with Vita and Tomas Zezula, introduction of a push model
for the braces matching would be reasonable solution. I belive Honza Lahoda worked on it, right?
Even after partiall fix of the problem - testing Source lock before entering into the deadlocks still happen. I belive
we need to address this issue within 6.5.
After many offline discussions with mfukala and tzezula I decided to change the infrastructure not to lock the document
before calling BracesMatcher implementations. This is a semantic change in the SPI, because BracesMatcher
implementations are now obliged to readlock the document if they directly search through its contents. If they use other
means of determining matching areas they may not need to lock the document at all. But the decision is up to them.
I updated all BracesMatcher implementations in the standard Netbeans distribution to comply with the changed semantics.
I'm also going to attach the diff with the API changes. The parts of the diff important for apireview are in
BracesMatcher.java (the actual change), CharacterMatcher.java (how it affects a typical existing client) and the obvious
Created attachment 68455 [details]
The changes in editor.bracesmatching
I kindly ask for reviewing this change. Thank you
I pushed the changes. Thanks