diff --git a/core/src/main/java/hudson/model/Queue.java b/core/src/main/java/hudson/model/Queue.java index 94cdd7f21778024666c6dabc59ccf685cb79b3bf..62b289e3f3b9d7555764e39f4ee5197a702c2637 100644 --- a/core/src/main/java/hudson/model/Queue.java +++ b/core/src/main/java/hudson/model/Queue.java @@ -121,6 +121,7 @@ import org.kohsuke.accmod.restrictions.DoNotUse; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import jenkins.util.SystemProperties; import javax.annotation.CheckForNull; import javax.annotation.Nonnegative; @@ -2769,11 +2770,13 @@ public class Queue extends ResourceController implements Saveable { return x; } + @SuppressFBWarnings(value = "IA_AMBIGUOUS_INVOCATION_OF_INHERITED_OR_OUTER_METHOD", + justification = "It will invoke the inherited clear() method according to Java semantics. " + + "FindBugs recommends suppresing warnings in such case") public void cancelAll() { for (T t : new ArrayList(this)) t.cancel(Queue.this); - - this.clear(); // just to be sure + clear(); } }