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 - Deadlock during writing in JSpEditor
Summary: Deadlock during writing in JSpEditor
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marek Fukala
URL:
Keywords:
: 122436 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-07 16:16 UTC by Petr Pisl
Modified: 2008-02-20 18:04 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thea dealock. (20.64 KB, text/plain)
2007-11-07 16:16 UTC, Petr Pisl
Details

Note You need to log in before you can comment on or make changes to this bug.
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