You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by sk...@apache.org on 2022/04/25 09:59:30 UTC

[netbeans] branch delivery updated: Fixing ElementJavadoc for files without package clause.

This is an automated email from the ASF dual-hosted git repository.

skygo pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new eb20bcf4f9 Fixing ElementJavadoc for files without package clause.
     new 3483a23a65 Merge pull request #4030 from jlahoda/javadoc-no-package
eb20bcf4f9 is described below

commit eb20bcf4f9b7babb2da28e2ced69612f1ea2e114
Author: Jan Lahoda <jl...@netbeans.org>
AuthorDate: Sun Apr 24 14:02:42 2022 +0200

    Fixing ElementJavadoc for files without package clause.
---
 .../src/org/netbeans/modules/java/lsp/server/protocol/ServerTest.java  | 2 --
 .../src/org/netbeans/api/java/source/ui/ElementJavadoc.java            | 3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/protocol/ServerTest.java b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/protocol/ServerTest.java
index 3fa49d6a3f..0525b4a910 100644
--- a/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/protocol/ServerTest.java
+++ b/java/java.lsp.server/test/unit/src/org/netbeans/modules/java/lsp/server/protocol/ServerTest.java
@@ -309,7 +309,6 @@ public class ServerTest extends NbTestCase {
         }
     }
 
-    @org.junit.Ignore
     public void testMain() throws Exception {
         File src = new File(getWorkDir(), "Test.java");
         src.getParentFile().mkdirs();
@@ -1282,7 +1281,6 @@ public class ServerTest extends NbTestCase {
                          "<none>:1:26-1:29", "<none>:2:12-2:15", "<none>:3:17-3:20");
     }
 
-    @org.junit.Ignore
     public void testHover() throws Exception {
         File src = new File(getWorkDir(), "Test.java");
         src.getParentFile().mkdirs();
diff --git a/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java b/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
index 1e844f332b..1a1b2521a7 100644
--- a/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
+++ b/java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
@@ -394,7 +394,8 @@ public class ElementJavadoc {
         this.fileObject = compilationInfo.getFileObject();
         this.handle = element == null ? null : ElementHandle.create(element);
         this.cancel = cancel;
-        this.packageName = compilationInfo.getCompilationUnit().getPackageName().toString();
+        this.packageName = compilationInfo.getCompilationUnit().getPackageName() != null ? compilationInfo.getCompilationUnit().getPackageName().toString()
+                                                                                         : "";
         this.imports = compilationInfo.getCompilationUnit().getImports();
         this.className = compilationInfo.getCompilationUnit().getSourceFile().getName().replaceFirst("[.][^.]+$", "");
 


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

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