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
Use Java 11 methods where possible #6700
Merged
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
21e8db0
Use Java 11 methods where possible
basil 68fd631
Whitelist java.util.ImmutableCollections
basil 85e99e9
Revert AbstractProject changes
basil f90c828
Add java.util.CollSer to serialization list
basil 816b87c
Merge remote-tracking branch 'origin/master' into java11-migration
basil bdfe07a
Keep list sorted
basil 8f063f0
Consume remoting incremental
basil 410e271
Use incremental of Stapler
basil 208a04e
IntelliJ suggestions
basil 8612540
Merge branch 'master' into java11-migration
basil a4252e9
Declare variable on the same line
basil 24cb4b3
Merge branch 'master' into java11-migration
basil 3bcbf57
Merge branch 'master' into java11-migration
basil a6ec1b0
Reverting incrementals
basil File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,7 +100,6 @@ | |
import java.io.PrintWriter; | ||
import java.io.Serializable; | ||
import java.io.StringWriter; | ||
import java.io.UnsupportedEncodingException; | ||
import java.lang.management.LockInfo; | ||
import java.lang.management.ManagementFactory; | ||
import java.lang.management.MonitorInfo; | ||
|
@@ -747,10 +746,7 @@ public static String appendSpaceIfNotNull(String n) { | |
public static String nbspIndent(String size) { | ||
int i = size.indexOf('x'); | ||
i = Integer.parseInt(i > 0 ? size.substring(0, i) : size) / 10; | ||
StringBuilder buf = new StringBuilder(30); | ||
for (int j = 2; j <= i; j++) | ||
buf.append(" "); | ||
return buf.toString(); | ||
return " ".repeat(Math.max(0, i - 1)); | ||
} | ||
|
||
public static String getWin32ErrorMessage(IOException e) { | ||
|
@@ -777,11 +773,7 @@ public static String urlEncode(String s) { | |
if (s == null) { | ||
return ""; | ||
} | ||
try { | ||
return URLEncoder.encode(s, StandardCharsets.UTF_8.name()); | ||
} catch (UnsupportedEncodingException e) { | ||
throw new Error(e); // impossible | ||
} | ||
return URLEncoder.encode(s, StandardCharsets.UTF_8); | ||
} | ||
|
||
public static String escape(String s) { | ||
|
@@ -1933,19 +1925,19 @@ public void calcCheckUrl(Map attributes, String userDefined, Object descriptor, | |
* | ||
* Used in {@code task.jelly} to decide if the page should be highlighted. | ||
*/ | ||
public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { | ||
public boolean hyperlinkMatchesCurrentPage(String href) { | ||
String url = Stapler.getCurrentRequest().getRequestURL().toString(); | ||
if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); | ||
url = URLDecoder.decode(url, "UTF-8"); | ||
href = URLDecoder.decode(href, "UTF-8"); | ||
url = URLDecoder.decode(url, StandardCharsets.UTF_8); | ||
href = URLDecoder.decode(href, StandardCharsets.UTF_8); | ||
if (url.endsWith("/")) url = url.substring(0, url.length() - 1); | ||
if (href.endsWith("/")) href = href.substring(0, href.length() - 1); | ||
|
||
return url.endsWith(href); | ||
} | ||
|
||
public <T> List<T> singletonList(T t) { | ||
return Collections.singletonList(t); | ||
return List.of(t); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incompatible I think: jenkinsci/emailext-template-plugin#71 (comment) |
||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
jenkinsci/stapler#377