You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "lahodaj (via GitHub)" <gi...@apache.org> on 2024/11/05 12:27:12 UTC

Re: [PR] LSP Server: Adding Null Checks in MoveRefactoring code action [netbeans]

lahodaj commented on code in PR #7923:
URL: https://github.com/apache/netbeans/pull/7923#discussion_r1829266680


##########
java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java:
##########
@@ -420,18 +420,26 @@ void doRefactoring(MoveElementUI ui) {
         }
 
         private static Project getSelectedProject(NamedPath selectedProject) {
+            String path = selectedProject == null ? null : selectedProject.getPath();
+            if (path == null) {
+                return null;
+            }
+            FileObject file;
             try {
-                String path = selectedProject.getPath();
-                return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null;
+                file = Utils.fromUri(path);

Review Comment:
   I would prefer if the patch would be smaller (e.g. `String path = selectedProject != null ? selectedProject.getPath() : null` is a one file change, and another similar change below), but I can live with this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists