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 59072 - Add a possibility to interrupt a thread
Summary: Add a possibility to interrupt a thread
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 5.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Martin Entlicher
Depends on: 59129
  Show dependency tree
Reported: 2005-05-19 16:48 UTC by Martin Entlicher
Modified: 2010-04-29 09:22 UTC (History)
2 users (show)

See Also:
Exception Reporter:

The proposed API change together with implementation. (5.18 KB, patch)
2005-05-20 14:12 UTC, Martin Entlicher
Details | Diff
Here is a simple solution that does not look bad, can be repeated in future if needed and is likely to pass API_REVIEW_FAST. Consider it, please. (1.61 KB, patch)
2005-06-03 05:01 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2005-05-19 16:48:12 UTC
Unless the thread is suspended, it should be possible to interrupt it.
In the Threads view, there can be "Interrupt" context action.
Comment 1 Martin Entlicher 2005-05-20 14:12:00 UTC
Would be a simple fix, if an API change is not necessary.
But we need to use the JPDAThread abstraction, which does not have interrupt()

Therefore we need a fast API review for this.
Comment 2 Martin Entlicher 2005-05-20 14:12:58 UTC
Created attachment 22222 [details]
The proposed API change together with implementation.
Comment 3 Martin Entlicher 2005-05-20 14:14:24 UTC
The JPDAThread interface is not to be implemented by the clients. Therefore a
method addition there should be considered as a compatible change.
Comment 4 Jaroslav Tulach 2005-05-20 14:55:53 UTC
Thanks for asking for review before the actual integration has happened. 
As far as I know the jpda api has official stability and thus we should try as 
much as we can to maintain it in compatible way[1], that is why I'd like you 
to consider solution that would evolve the api. Even if we do not know about 
someone subclassing the JPDAThread, by declaring the api official, we accept 
the fact that someone can do it and we have to behave like someone really did 
it[1]. Moreover I can imagine valid use case where subclassing is used for 
delegation and filtering (better name of a thread). Afaik this is encouraged 
by viewmodel's filters and thus it is not unlikely someone is trying that. 
That is why please do not add new method to your interface. 
Another thing I'd like to encourage is to write a test that the behaviour of 
INTERRUPT_ACTION is correct. Please check that it is disabled if old 
implementation of JPDAThread is passed in and enabled only if new 
implementation that supports interuptions is passed in. Should be pretty 
simple and gives meaningness to your api change. 
[1] of course we do not need to, if there is no way around, but in this case 
there seems to be one. 
Comment 5 Jan Jancura 2005-05-20 15:11:25 UTC
Yarda, I think that your argument is not valid. Martin would like to add some
method to API, which should not be recognized as incompatible change. 
Our Java debugger is based on JDI interface. JDI API contains many interfaces,
and these interfaces are changing (they are adding new nethods there). THis is
incompatible change in your rules!
I think that we can not use more strict rules for NetBeans APIs, than rules used
for JDK!
Reconsider it, please.
Comment 6 Martin Entlicher 2005-05-20 16:25:18 UTC
Removing from API review for now, we need to solve issue #59129 first.
Comment 7 Jaroslav Tulach 2005-06-03 05:01:21 UTC
Created attachment 22466 [details]
Here is a simple solution that does not look bad, can be repeated in future if needed and is likely to pass API_REVIEW_FAST. Consider it, please.
Comment 8 Martin Entlicher 2005-08-12 14:12:06 UTC
After issue #59129 is resolved, I'm moving this to review again. The review was
already requested in the past, but the change could not be done until issue
#59129 is resolved. Thus I expect this to be a seamless process...
The change is described in
Comment 9 Martin Entlicher 2005-08-18 11:23:57 UTC
Thanks for the review, I'll commit the change later today...
Comment 10 Martin Entlicher 2005-08-18 15:48:13 UTC
Fixed in trunk:

new revision: 1.27; previous revision: 1.26

/cvs/debuggerjpda/api/src/org/netbeans/api/debugger/jpda/,v  <--
new revision: 1.7; previous revision: 1.6

new revision: 1.13; previous revision: 1.12

/cvs/debuggerjpda/api/apichanges.xml,v  <--  apichanges.xml
new revision: 1.11; previous revision: 1.10

/cvs/debuggerjpda/api/,v  <--
new revision: 1.12; previous revision: 1.11
Comment 11 Quality Engineering 2010-04-29 09:22:43 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.