Skip to content

Commit

Permalink
fixed deprecated method call (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
AldenPratt authored Dec 10, 2023
1 parent 9b4fa75 commit 9e19e74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/main/java/hudson/plugins/accurev/AccurevSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,10 @@ public StandardUsernamePasswordCredentials getCredentials() {
return null;
} else {
return CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentials(
CredentialsProvider.lookupCredentialsInItemGroup(
StandardUsernamePasswordCredentials.class,
Jenkins.get(),
ACL.SYSTEM,
ACL.SYSTEM2,
URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build()),
CredentialsMatchers.withId(credentialsId));
}
Expand Down Expand Up @@ -971,10 +971,10 @@ public boolean migrateCredentials() {
fixNull(URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build());
List<StandardUsernamePasswordCredentials> credentials =
CredentialsMatchers.filter(
CredentialsProvider.lookupCredentials(
CredentialsProvider.lookupCredentialsInItemGroup(
StandardUsernamePasswordCredentials.class,
Jenkins.get(),
ACL.SYSTEM,
ACL.SYSTEM2,
domainRequirements),
CredentialsMatchers.withUsername(username));
for (StandardUsernamePasswordCredentials cred : credentials) {
Expand Down Expand Up @@ -1034,10 +1034,11 @@ public ListBoxModel doFillCredentialsIdItems(
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
return new StandardListBoxModel().includeCurrentValue(credentialsId);
}

return new StandardListBoxModel()
.includeEmptyValue()
.includeMatchingAs(
ACL.SYSTEM,
ACL.SYSTEM2,
Jenkins.get(),
StandardUsernamePasswordCredentials.class,
URIRequirementBuilder.fromUri("").withHostnamePort(host, port).build(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package hudson.plugins.accurev;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import io.jenkins.plugins.casc.ConfigurationAsCode;
import io.jenkins.plugins.casc.ConfiguratorException;
Expand Down

0 comments on commit 9e19e74

Please sign in to comment.