-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply some code modernization for Java 8 and recent Jenkins #148
Conversation
This updates code to use currently supported language features. Signed-off-by: Matt Sicker <[email protected]>
src/main/java/com/cloudbees/plugins/credentials/CredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/plugins/credentials/CredentialsProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/cloudbees/plugins/credentials/CredentialsProvider.java
Outdated
Show resolved
Hide resolved
iterator.remove(); | ||
} | ||
} | ||
resolverByName.values().removeIf(r -> r == ContextResolver.NONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or stream
iterator.remove(); | ||
} | ||
} | ||
providerByName.values().removeIf(p -> p == CredentialsProvider.NONE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or stream
src/main/java/com/cloudbees/plugins/credentials/CredentialsStore.java
Outdated
Show resolved
Hide resolved
iterator.remove(); | ||
} | ||
} | ||
requirements.removeIf(r -> r instanceof HostnamePortRequirement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Reviewer note: these cases are deliberately mutating, it seems.)
@@ -285,7 +285,7 @@ public void testNodeCredentialFingerprintsAreRemovedForNonExistentNodes() throws | |||
DumbSlave addedSlave = new DumbSlave("added-slave", | |||
"dummy", "/home/test/slave", "1", Node.Mode.NORMAL, "remote", | |||
new JNLPLauncher(), | |||
RetentionStrategy.INSTANCE, Collections.<NodeProperty<?>>emptyList()); | |||
RetentionStrategy.INSTANCE, Collections.emptyList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this constructor is deprecated and you can more easily use a simpler version.
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
Signed-off-by: Matt Sicker <[email protected]>
@@ -178,7 +178,7 @@ public CredentialsStore getStore(@CheckForNull ModelObject object) { | |||
} | |||
} | |||
} | |||
return new ArrayList<C>(); | |||
return new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return new ArrayList<>(); | |
return Collections.emptyList(); |
…sProvider.java Co-Authored-By: Raihaan Shouhell <[email protected]>
GitHub outage caused build failure. Closing to retry. |
This updates code to use currently supported language features.
Signed-off-by: Matt Sicker [email protected]