-
Notifications
You must be signed in to change notification settings - Fork 36
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
Introduce FilesCreateTempFileToFile
Refaster rule
#1162
base: master
Are you sure you want to change the base?
Conversation
879ba3a
to
25204a9
Compare
FilesCreateTempFileToFile
Refaster rule
Looks good. No mutations were possible for these changes. |
1 similar comment
Looks good. No mutations were possible for these changes. |
Looks good. No mutations were possible for these changes. |
Quality Gate failedFailed conditions |
|
||
@AfterTemplate | ||
File after(String prefix, String suffix) throws IOException { | ||
return Files.createTempFile(prefix, suffix).toFile(); |
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.
SonarCloud now compains about this line, while the [documentation](https://rules.sonarsource.com/java/type/Security Hotspot/RSPEC-5443) literally says:
File f = Files.createTempFile("prefix", "suffix").toFile(); // Compliant
I suppose this is something to be reported upstream (either it's incorrect, or unclear).
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.
Clean 🚀
|
||
/** | ||
* Prefer {@link Files#createTempFile(String, String, FileAttribute[])} over alternatives that | ||
* create files will more liberal permissions. |
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.
* create files will more liberal permissions. | |
* create files with more liberal permissions. |
Suggested commit message:
Inspired by apache/maven-install-plugin#47, found through #1159.