-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Fix more DM_DEFAULT_ENCODING
SpotBugs violations
#6098
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
98b0a3e
Fix more `DM_DEFAULT_ENCODING` SpotBugs violations
basil 72d1a11
Inbound agent logs are stored on the controller, so they should be in…
basil 3f8783c
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 30658ee
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 56ca70e
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 28dcba1
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 106ace3
Document the status quo
basil 98fb885
Make TextFile internally consistent
basil 758af4d
Revert "Make TextFile internally consistent"
basil 7dca57c
Deprecate TextFile methods that use the default charset
basil 8211d01
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil b30b7ac
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 907a10f
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 797076f
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil 72353c8
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil febd273
Fix a few more violations
basil b8d3f88
Deprecate methods without an explicit character set
basil fcf6413
Typo
basil f6553b5
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil b1d9436
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil e4b4978
Revert TextFile changes
basil 1507bac
Merge remote-tracking branch 'origin/master' into DM_DEFAULT_ENCODING
basil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,9 +33,12 @@ | |
import hudson.util.StreamTaskListener; | ||
import hudson.util.jna.Kernel32; | ||
import java.io.File; | ||
import java.io.FileWriter; | ||
import java.io.IOException; | ||
import java.io.Writer; | ||
import java.net.URL; | ||
import java.nio.charset.Charset; | ||
import java.nio.file.Files; | ||
import java.nio.file.StandardOpenOption; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import jenkins.model.Jenkins; | ||
|
@@ -110,7 +113,7 @@ public void rewriteHudsonWar(File by) throws IOException { | |
File baseDir = getBaseDir(); | ||
File copyFiles = new File(baseDir, baseName + ".copies"); | ||
|
||
try (FileWriter w = new FileWriter(copyFiles, true)) { | ||
try (Writer w = Files.newBufferedWriter(Util.fileToPath(copyFiles), Charset.defaultCharset(), StandardOpenOption.CREATE, StandardOpenOption.APPEND)) { | ||
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. A Windows-specific file, so we cannot assume UTF-8. |
||
w.write(by.getAbsolutePath() + '>' + getHudsonWar().getAbsolutePath() + '\n'); | ||
} | ||
} | ||
|
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
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.
Just a few lines above, the Javadoc states (emphasis mine):