Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBIDE-21707 NullPointerException in JobResultFuture #488

Merged
merged 1 commit into from
Feb 17, 2016

Conversation

scabanovich
Copy link
Contributor

No description provided.

@@ -41,12 +41,13 @@ public JobResultFuture(Job job) {

@Override
public boolean cancel(boolean mayInterruptIfRunning) {
if ((isRunning(job)
&& mayInterruptIfRunning)
|| !isRunning(job)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why cancel the job if it's not running?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be still waiting or sleeping. JobManager does all the checks and changes state to NONE. So, even if the current state of job is NONE, it does not harm to call cancel().
For the boolean expression, I only made it a bit shorter, but it is equivalent to what it was.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

State 'sleeping' may mean UI jobs deadlock, the ability to cancel a sleeping job is the true way to salvation.

@fbricon
Copy link
Member

fbricon commented Feb 17, 2016

+1 LGTM

@fbricon fbricon merged commit f210128 into jbosstools:master Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants