From 6d12f014c16fda73feb859516e1c470bd043be0b Mon Sep 17 00:00:00 2001 From: Shivam Madan Date: Tue, 29 Oct 2024 15:52:11 +0530 Subject: [PATCH] Patch for MoveRefactoring null error fix --- build.xml | 1 + patches/7923_draft.diff | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 patches/7923_draft.diff diff --git a/build.xml b/build.xml index ab6b363..faf2fa3 100644 --- a/build.xml +++ b/build.xml @@ -58,6 +58,7 @@ patches/7750.diff patches/7910.diff patches/7921.diff + patches/7923_draft.diff patches/mvn-sh.diff patches/generate-dependencies.diff patches/rename-debugger.diff diff --git a/patches/7923_draft.diff b/patches/7923_draft.diff new file mode 100644 index 0000000..beac77e --- /dev/null +++ b/patches/7923_draft.diff @@ -0,0 +1,22 @@ +diff --git a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java +index a72abd44ef..199ffad108 100644 +--- a/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java ++++ b/java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/refactoring/MoveRefactoring.java +@@ -423,7 +423,7 @@ public final class MoveRefactoring extends CodeRefactoring { + try { + String path = selectedProject.getPath(); + return path != null ? FileOwnerQuery.getOwner(Utils.fromUri(path)) : null; +- } catch (MalformedURLException ex) { ++ } catch (MalformedURLException | NullPointerException ex) { + return null; + } + } +@@ -432,7 +432,7 @@ public final class MoveRefactoring extends CodeRefactoring { + try { + String path = selectedRoot.getPath(); + return path != null ? Utils.fromUri(path) : null; +- } catch (MalformedURLException ex) { ++ } catch (MalformedURLException | NullPointerException ex) { + return null; + } + }