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 - Thread...interrupt() does not work for BracesMatcher
Summary: Thread...interrupt() does not work for BracesMatcher
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@editor
URL: http://statistics.netbeans.org/except...
Keywords: API, RANDOM
Depends on:
Blocks:
 
Reported: 2007-09-04 15:41 UTC by Peter Pis
Modified: 2007-11-09 13:11 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 1779


Attachments
stacktrace (4.11 KB, text/plain)
2007-09-04 15:41 UTC, Peter Pis
Details

Note You need to log in before you can comment on or make changes to this bug.
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]
stacktrace
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 MasterMatcher.java;
/cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java,v  <--  MasterMatcher.java
new revision: 1.7; previous revision: 1.6
done
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
http://statistics.netbeans.org/exceptions/detail.do?id=8991
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/MasterMatcherTest.java' for addition
cvs server: use 'cvs commit' to add this file permanently
Checking in manifest.mf;
/cvs/editor/bracesmatching/manifest.mf,v  <--  manifest.mf
new revision: 1.5; previous revision: 1.4
done
Checking in apichanges.xml;
/cvs/editor/bracesmatching/apichanges.xml,v  <--  apichanges.xml
new revision: 1.5; previous revision: 1.4
done
Checking in src/org/netbeans/spi/editor/bracesmatching/BracesMatcher.java;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/BracesMatcher.java,v  <--  BracesMatcher.java
new revision: 1.5; previous revision: 1.4
done
Checking in src/org/netbeans/spi/editor/bracesmatching/MatcherContext.java;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/MatcherContext.java,v  <--  MatcherContext.java
new revision: 1.3; previous revision: 1.2
done
Removing test/unit/src/org/netbeans/modules/editor/bracesmacthing/MasterMatcherTest.java;
/cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmacthing/MasterMatcherTest.java,v  <-- 
MasterMatcherTest.java
new revision: delete; previous revision: 1.2
done
Checking in src/org/netbeans/spi/editor/bracesmatching/support/BracesMatcherSupport.java;
/cvs/editor/bracesmatching/src/org/netbeans/spi/editor/bracesmatching/support/BracesMatcherSupport.java,v  <-- 
BracesMatcherSupport.java
new revision: 1.3; previous revision: 1.2
done
Checking in src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java;
/cvs/editor/bracesmatching/src/org/netbeans/modules/editor/bracesmatching/MasterMatcher.java,v  <--  MasterMatcher.java
new revision: 1.8; previous revision: 1.7
done
RCS file: /cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmatching/MasterMatcherTest.java,v
done
Checking in test/unit/src/org/netbeans/modules/editor/bracesmatching/MasterMatcherTest.java;
/cvs/editor/bracesmatching/test/unit/src/org/netbeans/modules/editor/bracesmatching/MasterMatcherTest.java,v  <-- 
MasterMatcherTest.java
initial revision: 1.1
done
Comment 11 damian_nb 2007-11-09 13:11:06 UTC
verified with
NetBeans IDE 6.0 RC1 (Build 200711081200)