[#2079] fix(Files): Change the method to compare if two file refers to the same one#1120
Merged
xael-fry merged 1 commit intoplayframework:masterfrom Mar 28, 2017
Merged
Conversation
60074d1 to
f774bf0
Compare
asolntsev
requested changes
Mar 13, 2017
framework/src/play/utils/Utils.java
Outdated
| public static void kill(String pid) throws Exception { | ||
| String os = System.getProperty("os.name"); | ||
| String command = (os.startsWith("Windows")) ? "taskkill /F /PID " + pid : "kill " + pid; | ||
| String command = (Os.isWindows()) ? "taskkill /F /PID " + pid : "kill " + pid; |
Contributor
There was a problem hiding this comment.
remove extra braces around Os.isWindows()
framework/src/play/utils/Os.java
Outdated
| /** | ||
| * Os detections | ||
| */ | ||
| public class Os { |
Contributor
There was a problem hiding this comment.
What about renaming Os to OS?
It seems more natural for me because "OS" is a well-known acronym.
framework/src/play/Play.java
Outdated
| // Modules path is prepended with a env property | ||
| if (System.getenv("MODULES") != null && System.getenv("MODULES").trim().length() > 0) { | ||
| for (String m : System.getenv("MODULES").split(System.getProperty("os.name").startsWith("Windows") ? ";" : ":")) { | ||
| for (String m : System.getenv("MODULES").split(Os.isWindows() ? ";" : ":")) { |
Contributor
There was a problem hiding this comment.
Can't we use just File.pathSeparator instead of this tricky hack?
According to javadoc,
On UNIX systems, this character is
':'; on Microsoft Windows systems it is';'.
… to the same one * refactor(os): add a new utils class to make easiest the os detection
f774bf0 to
f628291
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Lighthouse #2079