-
Notifications
You must be signed in to change notification settings - Fork 24
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
[69] NullPointer exception in eco code java Sonar plugin #70
base: main
Are you sure you want to change the base?
[69] NullPointer exception in eco code java Sonar plugin #70
Conversation
d29ec24
to
e43b26d
Compare
@@ -0,0 +1,45 @@ | |||
package files; |
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.
please rename this test class with an explicit name corresponding to use case instead of "2"
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 will done it if you want after the merge of this PR (if you don't have time to do it)
* The "try" should have been poped from the stack before entering here | ||
*/ | ||
private void calledMethodWithoutTry() throws IOException { | ||
FileWriter myWriter = new FileWriter("somefilepath"); |
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.
sorry, but for me, this use case is an "non compliant" case.
This is a good example explaining that if the FileWriter is instanciated inside a private method, it must be protected with a try-with-resource. In this case, it must be done.
Sorry I can't accept the correction ... for me, the global algorithm must be refactored to manage this use case !
Quality Gate passedIssues Measures |
This PR has been automatically marked as stale because it has no activity for 30 days. |
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
No description provided.