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 241444 - ORG.NETBEANS.JARCLASSLOADER CLEARS THREAD'S INTERRUPTED STATE
Summary: ORG.NETBEANS.JARCLASSLOADER CLEARS THREAD'S INTERRUPTED STATE
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 8.0
Hardware: PC All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: NO80
Depends on:
Blocks:
 
Reported: 2014-02-05 13:49 UTC by mark.warner
Modified: 2014-04-02 01:38 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mark.warner 2014-02-05 13:49:22 UTC
Problem Description:
--------------------
I'm trying to work on making one of our long running tasks cancellable. I have hit a problem with the netbeans classloader code.

If the current Thread is interrupted before (or while) JarClassLoader is used (in our case because we're using the bean Introspector on some classes) then it will no longer be interrupted when JarClassLoader has finished.

Error-Stack Obtained / Diagnostic Analysis:
-------------------------------------------
The cause would seem to be a catch( InterruptedException ) in org.netbeans.JarClassLoader which doesn't re-throw, and doesn't ensure Thread.currentThread().interrupt().

I found this one example, but I'm guessing there may be others in the netbeans classloader code.

The code base should be checked to ensure that InterruptedException is dealt with properly (i.e. at least call Thread.currentThread.interrupt() if not handling it.

http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html
Comment 1 Jaroslav Tulach 2014-03-31 08:06:01 UTC
I see one method that deals with interrupts in JarClassLoader. Here is the attempt to propagate the state:

changeset:   http://hg.netbeans.org/ergonomics/rev/41bd41fea39e
tag:         tip
parent:      35b2705af4c1
user:        Jaroslav Tulach <jtulach@netbeans.org>
date:        Mon Mar 31 10:01:19 2014 +0200
summary:     #241444: Propagate interrupted state
Comment 2 Quality Engineering 2014-04-02 01:38:57 UTC
Integrated into 'main-silver', will be available in build *201404020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/41bd41fea39e
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #241444: Propagate interrupted state