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 124697

Summary: Get status if a progress handle is started or not
Product: platform Reporter: Jiri Rechtacek <jrechtacek>
Component: ProgressAssignee: Jan Peska <JPESKA>
Status: RESOLVED WONTFIX    
Severity: blocker CC: jglick, nigjo_iqn
Priority: P2 Keywords: API, THREAD
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Jiri Rechtacek 2008-01-04 10:46:06 UTC
No way how to get status of a progress handle. I need to know if some handle was started before I need to finish it.
A possible workaround: pair handle with some status field about its status.
Comment 1 Milos Kleint 2008-01-04 11:54:21 UTC
you are finishing 3rd party handles? or how can you not know about the handle's state?
Comment 2 nigjo_iqn 2011-06-03 14:01:26 UTC
voted for this.

Why should I store the state by myself? The "internalHandle" already has a method "getState()" which could be reused.

In my case I create a new ProgressHandle instance in an own "Manager" who does some common initialization to the handle. This Manager also has "start()", "stop()" and "interrutProgressOnError()" methods. The latter may be called before "start()", after creating an instance. But in that case this method will throw an unnecessary Exception by itself without an "isStarted()" or "isRunning()" method.
Comment 3 Jesse Glick 2011-08-19 15:21:42 UTC
Probably WONTFIX - a ProgressHandle is supposed to be thread-safe, so returning a status code does not guarantee that this status is still in effect when you make another call, since there is no transactional mechanism.

You just need to keep track of what you have done with a handle so far, and not make inappropriate calls on it.
Comment 4 Jan Peska 2011-08-30 09:54:45 UTC
(In reply to comment #3)
> Probably WONTFIX - a ProgressHandle is supposed to be thread-safe, so returning
> a status code does not guarantee that this status is still in effect when you
> make another call, since there is no transactional mechanism.
> 
> You just need to keep track of what you have done with a handle so far, and not
> make inappropriate calls on it.

-> WONTFIX