LSP Server: Adding Null Checks in MoveRefactoring code action#7923
LSP Server: Adding Null Checks in MoveRefactoring code action#7923mbien merged 1 commit intoapache:masterfrom
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
lahodaj
left a comment
There was a problem hiding this comment.
Looks better to me, thanks!
mbien
left a comment
There was a problem hiding this comment.
thanks, tests are also green -> merging