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 114651

Summary: Thread...interrupt() does not work for BracesMatcher
Product: editor Reporter: Peter Pis <ppis>
Component: Painting & PrintingAssignee: issues@editor <issues>
Severity: blocker CC: damian_nb, jhorvath
Priority: P3 Keywords: API, RANDOM
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 1779
Attachments: stacktrace

Description Peter Pis 2007-09-04 15:41:30 UTC
Build: NetBeans IDE Dev (Build 200709040000)
VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04
OS: Windows XP, 5.1, x86

User Comments: 

Editing source of java file got an exception.
Comment 1 Peter Pis 2007-09-04 15:41:34 UTC
Created attachment 48068 [details]
Comment 2 pzajac 2007-09-04 16:02:36 UTC
reassigned to editor
Comment 3 Vitezslav Stejskal 2007-09-06 12:01:38 UTC
An interesting one, I assume this isn't reliably reproducible, right?
Comment 4 Vitezslav Stejskal 2007-10-11 15:46:10 UTC
Checking in;
/cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/,v  <--
new revision: 1.7; previous revision: 1.6
Comment 5 Peter Pis 2007-10-19 12:58:29 UTC
Haven't seen it. Verified.
Comment 6 damian_nb 2007-10-23 20:09:34 UTC
got with nightly build (071023) after new class has been created
Comment 7 Vitezslav Stejskal 2007-10-24 12:20:05 UTC
Could you please attach the stacktrace? Thanks
Comment 8 damian_nb 2007-10-24 18:38:36 UTC
hope it helps
Comment 9 Vitezslav Stejskal 2007-10-26 11:05:02 UTC
Yes, it helped, thanks. After all it looks like using Thread.interrupt() for canceling braces matcher tasks was not the
best idea. The exception is caught and reported from FolderPathLookup$ICItem.getInstance, which legally thinks that
instance file is broken. Obviously this code knows nothing about the fact that it is used from MasterMatcher, which task
was just canceled. IMO we will have to introduce something like 'public static boolean isTaskCanceled()' in
BracesMatcher, which would do the same, but without interfering with synchronization primitives.
Comment 10 Vitezslav Stejskal 2007-11-03 23:23:15 UTC
Should now work better. I added MatcherContext.isTaskCanceled() and stopped using Thread.interrupt() and
Thread.isInterrupted(), which may have interfered with an internal synchronization of code used by braces matching tasks.

irectory /cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmatching added to the repository
cvs server: scheduling file `bracesmatching/' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in;
/cvs/editor/bracesmatching/,v  <--
new revision: 1.5; previous revision: 1.4
Checking in apichanges.xml;
/cvs/editor/bracesmatching/apichanges.xml,v  <--  apichanges.xml
new revision: 1.5; previous revision: 1.4
Checking in src/org/netbeans/spi/editor/bracesmatching/;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/,v  <--
new revision: 1.5; previous revision: 1.4
Checking in src/org/netbeans/spi/editor/bracesmatching/;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/,v  <--
new revision: 1.3; previous revision: 1.2
Removing test/unit/src/org/netbeans/modules/editor/bracesmacthing/;
/cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmacthing/,v  <--
new revision: delete; previous revision: 1.2
Checking in src/org/netbeans/spi/editor/bracesmatching/support/;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/support/,v  <--
new revision: 1.3; previous revision: 1.2
Checking in src/org/netbeans/modules/editor/bracesmatching/;
/cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/,v  <--
new revision: 1.8; previous revision: 1.7
RCS file: /cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmatching/,v
Checking in test/unit/src/org/netbeans/modules/editor/bracesmatching/;
/cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmatching/,v  <--
initial revision: 1.1
Comment 11 damian_nb 2007-11-09 13:11:06 UTC
verified with
NetBeans IDE 6.0 RC1 (Build 200711081200)