提交 734f16dd 编写于 作者: O Oleg Nenashev

FindBugs: get rid of the redundant null check in...

FindBugs: get rid of the redundant null check in hudson.model.queue.Executables#getEstimatedDurationFor()
上级 f510d1c0
......@@ -67,14 +67,17 @@ public class Executables {
* or if the executor thread exits prematurely, see JENKINS-30456
* Protects against {@link AbstractMethodError}s if the {@link Executable} implementation
* was compiled against Hudson < 1.383
*
* @param e Executable item
* @return the estimated duration for a given executable, -1 if the executable is null
*/
public static long getEstimatedDurationFor(@CheckForNull Executable e) {
if (e == null) {
return -1;
}
try {
return (e != null) ? e.getEstimatedDuration() : -1;
return e.getEstimatedDuration();
} catch (AbstractMethodError error) {
return (e != null) ? e.getParent().getEstimatedDuration() : -1;
return e.getParent().getEstimatedDuration();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册