-
Notifications
You must be signed in to change notification settings - Fork 874
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
LSP Server: Adding Null Checks in MoveRefactoring code action #7923
Conversation
shivam71
commented
Oct 29, 2024
- Initially when creating the refactoring web view the variables selectedProject and selectedRoot are NULL.
- getPath method called on a null results in a null pointer exception .
- Uncaught null pointer exception was leading to refactoring failing sometimes . Hence this fix is required .
catching NPEs isn't a good practice. This should be solved at the point where the NPE occurs if possible. |
+1 - catching a NPE is almost always the bad solution. If something can validly be null, there should be a In this case, I have a question: if the |
6d8a989
to
4380550
Compare
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java
Outdated
Show resolved
Hide resolved
4380550
to
0bb6141
Compare
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.
Looks better to me, thanks!
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.
thanks, tests are also green -> merging