Skip to content

Commit

Permalink
Merge pull request #65 from basil/guava-set
Browse files Browse the repository at this point in the history
Reduce usages of Guava
  • Loading branch information
car-roll authored Dec 8, 2021
2 parents ca06c9d + ad86ac5 commit 08f7635
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package org.jenkinsci.plugins.workflow.steps;

import com.google.common.collect.Sets;
import hudson.AbortException;
import hudson.Functions;
import hudson.model.Executor;
Expand Down Expand Up @@ -121,7 +120,8 @@ public void handle(Run<?,?> run, TaskListener listener) {
for (InterruptedBuildAction a : run.getActions(InterruptedBuildAction.class)) {
boundCauses.addAll(a.getCauses());
}
Collection<CauseOfInterruption> diff = Sets.difference(new LinkedHashSet<>(causes), boundCauses);
Set<CauseOfInterruption> diff = new LinkedHashSet<>(causes);
diff.removeAll(boundCauses);
if (!diff.isEmpty()) {
run.addAction(new InterruptedBuildAction(diff));
for (CauseOfInterruption cause : diff) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package org.jenkinsci.plugins.workflow.steps;

import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.ExtensionList;
Expand Down Expand Up @@ -66,7 +65,7 @@ public abstract class StepDescriptor extends Descriptor<Step> {
* if your step cannot trivially handle a null value of a given kind, list that type here.
* The Pipeline execution engine will then signal a user error before even starting your step if called in an inappropriate context.
* For example, a step requesting a {@link Launcher} may only be run inside a {@code node {…}} block.
* @return typically an {@link ImmutableSet#of(Object)} with context types like {@link TaskListener} or {@link Run} or {@link FilePath}
* @return a set of context types like {@link TaskListener} or {@link Run} or {@link FilePath}
*/
public abstract Set<? extends Class<?>> getRequiredContext();

Expand Down

0 comments on commit 08f7635

Please sign in to comment.