Skip to content

Commit

Permalink
Merge pull request #65 from basil/guava
Browse files Browse the repository at this point in the history
Reduce usages of Guava
  • Loading branch information
jglick authored Jan 3, 2022
2 parents ace2b25 + 4234afa commit f262988
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.jenkinsci.plugins.workflow.support.steps.input;

import com.google.common.collect.Sets;
import hudson.Extension;
import hudson.Util;
import hudson.model.ParameterDefinition;
import hudson.model.PasswordParameterDefinition;
import hudson.util.Secret;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -140,7 +140,8 @@ public boolean canSubmit() {
public boolean canSettle(Authentication a) {
if (submitter==null)
return true;
final Set<String> submitters = Sets.newHashSet(submitter.split(","));
final Set<String> submitters = new HashSet<>();
Collections.addAll(submitters, submitter.split(","));
if (submitters.contains(a.getName()))
return true;
for (GrantedAuthority ga : a.getAuthorities()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.cloudbees.plugins.credentials.CredentialsParameterValue;
import com.cloudbees.plugins.credentials.builds.CredentialsParameterBinder;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import hudson.FilePath;
import hudson.Util;
Expand Down Expand Up @@ -306,7 +305,8 @@ private boolean canSettle(Authentication a) {
if (!Jenkins.get().isUseSecurity() || Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
return true;
}
final Set<String> submitters = Sets.newHashSet(submitter.split(","));
final Set<String> submitters = new HashSet<>();
Collections.addAll(submitters, submitter.split(","));
final SecurityRealm securityRealm = Jenkins.get().getSecurityRealm();
if (isMemberOf(a.getName(), submitters, securityRealm.getUserIdStrategy()))
return true;
Expand Down

0 comments on commit f262988

Please sign in to comment.