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 121383

Summary: Deadlock during writing in JSpEditor
Product: javaee Reporter: Petr Pisl <ppisl>
Component: JSPAssignee: Marek Fukala <mfukala>
Status: VERIFIED FIXED    
Severity: blocker CC: mschovanek, non_migrated_user, pjiricka
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Thea dealock.

Description Petr Pisl 2007-11-07 16:16:14 UTC
I just write a text (probably it was invoked auto code completion) and get the deadlock.
Comment 1 Petr Pisl 2007-11-07 16:16:45 UTC
Created attachment 52667 [details]
Thea dealock.
Comment 2 Marek Fukala 2007-11-07 21:37:58 UTC
This is my fault :-(

I overlooked that the JspCompletionItem$JspCompletionItem.substituteText() calls
JspCompletionItem$JspCompletionItem.reformat() method under document.atomicLock(). This breaks the paradigm
Reformat.lock() firts, then Document.atomicLock(). 

So after Reformat.lock() is called the infrastructure calls java Reformatter.lock() which tries to get java compiler's
lock. "Java Source Worked Thread" however holds the javac lock and tries to readLock() the document.

Fixed by removing the JspCompletionItem$JspCompletionItem.reformat() call from the atomicLock block.

The fix needs to be ported to 6.0 branch. BTW, html implementation is OK.

fixed in trunk

Checking in JspCompletionItem.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/completion/JspCompletionItem.java,v  <--  JspCompletionItem.java
new revision: 1.19; previous revision: 1.18
done
Comment 3 Marek Fukala 2007-11-07 21:44:09 UTC
Correction: JspCompletionItem$JspResultItem.*
Comment 4 Dusan Balek 2007-11-28 09:16:00 UTC
*** Issue 122436 has been marked as a duplicate of this issue. ***
Comment 5 Jindrich Sedek 2008-01-31 14:58:45 UTC
verified 
NetBeans IDE Dev (Build 200801310006)
Comment 6 khu 2008-02-05 18:37:14 UTC
The fix has been ported into the release601_fixes branch.

Checking in JspCompletionItem.java;
/cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/completion/Attic/JspCompletionItem.java,v  <-- 
JspCompletionItem.java
new revision: 1.18.6.1; previous revision: 1.18
done