-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(PathManager): allow paths to be symlinks #5036
Conversation
Useful for directories like cachedModules.
%n is only a newline when run through a Formatter (or printf).
@@ -97,11 +98,11 @@ private static Path findInstallPath() { | |||
} | |||
} | |||
|
|||
System.err.println( | |||
System.err.printf( |
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.
Does PMD have a valid point here in asking to use a logger instead of plain write to console?
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.
PathManager sometimes does stuff like this I wouldn't do elsewhere because it's so early in the boot sequence. Do you use the logger while initializing the object that's responsible for providing getLogPath
?
(maybe? like, it'll still print WARN and ERROR to the console, right? idk)
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.
I would hope that the logger setup works for whatever code we write "afterwards", including the path manager and all that - but I'm not sure about that either.
No need to change this right now in this PR, but maybe we can keep it in mind/try it out in the future.
@@ -97,11 +98,11 @@ private static Path findInstallPath() { | |||
} | |||
} | |||
|
|||
System.err.println( | |||
System.err.printf( |
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.
I would hope that the logger setup works for whatever code we write "afterwards", including the path manager and all that - but I'm not sure about that either.
No need to change this right now in this PR, but maybe we can keep it in mind/try it out in the future.
- suppress for LoggingContext.java and Terasology.java because logging not necessarily available yet there - refactor for PathManager.java as logger is already in use in that context, also see previous discussion in #5036 (comment)
* qa: fix PMD CollapsibleIfStatements finding * qa: fix PMD SimplifiedTernary findings * fix: formatting mistake * qa: address PMD SystemPrintln findings - suppress for LoggingContext.java and Terasology.java because logging not necessarily available yet there - refactor for PathManager.java as logger is already in use in that context, also see previous discussion in #5036 (comment) * qa: address PMD InvalidLogMessageFormat finding - if I understand https://stackoverflow.com/questions/7102339/is-there-a-correct-way-to-pass-arguments-in-slf4j correctly, this should not be less performant but valid SLF4j format * qa: address PMD AvoidBranchingStatementAsLastInLoop findings * qa: address PMD ForLoopCanBeForeach findings * chore: remove unused import * qa: address PMD AvoidPrintStackTrace findings * chore: remove unused imports * chore: fix checkstyle DeclarationOrderCheck warning
Useful for directories like cachedModules.
How to test
In your Terasology home directory, replace
cachedModules
with a symlink. For exampleMake sure you can still start the game and that it is able to load modules.