-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Switch to calling Files.newBufferedReader #3210
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,8 +76,8 @@ | |
| import java.io.BufferedReader; | ||
| import java.io.File; | ||
| import java.io.IOException; | ||
| import java.io.InputStreamReader; | ||
| import java.lang.ref.WeakReference; | ||
| import java.nio.charset.Charset; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.Calendar; | ||
|
|
@@ -377,7 +377,7 @@ public void load() { | |
| // first try the old format | ||
| File queueFile = getQueueFile(); | ||
| if (queueFile.exists()) { | ||
| try (BufferedReader in = new BufferedReader(new InputStreamReader(Files.newInputStream(queueFile.toPath())))) { | ||
| try (BufferedReader in = Files.newBufferedReader(queueFile.toPath(), Charset.defaultCharset())) { | ||
|
Member
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. I wonder why we're not using UTF-8 here.
Member
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. dunno. I am fine with fixing it in a separate PR. So far I think that all admins running Jenkins with non-UTF-8 just like to live dangerously, so I just wish them good luck
Author
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.
Author
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. I created PR #3224 to switch to UTF-8. |
||
| String line; | ||
| while ((line = in.readLine()) != null) { | ||
| AbstractProject j = Jenkins.getInstance().getItemByFullName(line, AbstractProject.class); | ||
|
|
||
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.
would be nice to use
Util.fileToPathto avoid Runtime exceptions. But it can be done in a separate PRThere 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.
I created PR #3219 to use fileToPath().