提交 f2a39b52 编写于 作者: J Jesse Glick

Failed to diagnose an NPE in 1.554.3.

WARNING: Caught exception evaluating: e.hasStopPermission() in /. Reason: java.lang.NullPointerException
java.lang.NullPointerException
	at hudson.model.Executor.hasStopPermission(Executor.java:523)
上级 6a418ba2
...@@ -1278,14 +1278,13 @@ public class Queue extends ResourceController implements Saveable { ...@@ -1278,14 +1278,13 @@ public class Queue extends ResourceController implements Saveable {
public interface Executable extends Runnable { public interface Executable extends Runnable {
/** /**
* Task from which this executable was created. * Task from which this executable was created.
* Never null.
* *
* <p> * <p>
* Since this method went through a signature change in 1.377, the invocation may results in * Since this method went through a signature change in 1.377, the invocation may results in
* {@link AbstractMethodError}. * {@link AbstractMethodError}.
* Use {@link Executables#getParentOf(Queue.Executable)} that avoids this. * Use {@link Executables#getParentOf(Queue.Executable)} that avoids this.
*/ */
SubTask getParent(); @Nonnull SubTask getParent();
/** /**
* Called by {@link Executor} to perform the task * Called by {@link Executor} to perform the task
......
...@@ -27,6 +27,7 @@ import hudson.model.Queue.Executable; ...@@ -27,6 +27,7 @@ import hudson.model.Queue.Executable;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import javax.annotation.Nonnull;
/** /**
* Convenience methods around {@link Executable}. * Convenience methods around {@link Executable}.
...@@ -37,7 +38,7 @@ public class Executables { ...@@ -37,7 +38,7 @@ public class Executables {
/** /**
* Due to the return type change in {@link Executable}, the caller needs a special precaution now. * Due to the return type change in {@link Executable}, the caller needs a special precaution now.
*/ */
public static SubTask getParentOf(Executable e) { public static @Nonnull SubTask getParentOf(Executable e) {
try { try {
return _getParentOf(e); return _getParentOf(e);
} catch (AbstractMethodError _) { } catch (AbstractMethodError _) {
......
...@@ -29,8 +29,6 @@ import hudson.model.Node; ...@@ -29,8 +29,6 @@ import hudson.model.Node;
import hudson.model.Queue.Executable; import hudson.model.Queue.Executable;
import hudson.model.Queue.Task; import hudson.model.Queue.Task;
import hudson.model.ResourceActivity; import hudson.model.ResourceActivity;
import hudson.security.ACL;
import org.acegisecurity.Authentication;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
...@@ -78,7 +76,7 @@ public interface SubTask extends ResourceActivity { ...@@ -78,7 +76,7 @@ public interface SubTask extends ResourceActivity {
/** /**
* Gets the {@link Task} that this subtask belongs to. * Gets the {@link Task} that this subtask belongs to.
*/ */
Task getOwnerTask(); @Nonnull Task getOwnerTask();
/** /**
* If a subset of {@link SubTask}s of a {@link Task} needs to be collocated with other {@link SubTask}s, * If a subset of {@link SubTask}s of a {@link Task} needs to be collocated with other {@link SubTask}s,
......
...@@ -81,7 +81,7 @@ public class Tasks { ...@@ -81,7 +81,7 @@ public class Tasks {
return t.getOwnerTask(); return t.getOwnerTask();
} }
public static Task getOwnerTaskOf(SubTask t) { public static @Nonnull Task getOwnerTaskOf(@Nonnull SubTask t) {
try { try {
return _getOwnerTaskOf(t); return _getOwnerTaskOf(t);
} catch (AbstractMethodError e) { } catch (AbstractMethodError e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册