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.
Just a few minutes ago I needed to make my hint cancelable. What is the current advice? public class Hint extends AbstractHint { private volatile boolean stop; public Hint run(CompilationInfo info) { stop = false; // ... if (stop) { return null; } } public void cancel() { stop = true; } It is far too much code for my own taste and also the code is not really bulletproof. "stop" is a variable associated with one invocation not with the instance of the hint. If scheduler will suspend the run method before "stop = false;", other thread will call cancel, then the run method continues, the cancel never really happens. I want easier way to handle cancel, without this concurrent subtlety: Why not have public final boolean CompilationInfo.isCanceled(); method? The above code would than be just: public class Hint extends AbstractHint { public Hint run(CompilationInfo info) { if (info.isCancelled()) { return null; } } } simpler, and without threading issues.
Needs huge API change but seems very elegant.
The nicest solution without a big change is to support both the current call of cancel () method and in addition to this we may add the isCanceled() method to CompilationInfo as Jarda suggested.
moving opened issues from TM <= 6.1 to TM=Dev