You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ne...@apache.org on 2022/02/01 15:26:07 UTC
[netbeans] branch delivery updated: [#3511] workaround for extends/implements panel not showing any results.
This is an automated email from the ASF dual-hosted git repository.
neilcsmith 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 3231d64 [#3511] workaround for extends/implements panel not showing any results.
new 4153d97 Merge pull request #3543 from mbien/show-finals-workaround_delivery
3231d64 is described below
commit 3231d6421dd653eb93ff7032c330beb792f5ea01
Author: Michael Bien <mb...@gmail.com>
AuthorDate: Mon Jan 31 13:04:42 2022 +0100
[#3511] workaround for extends/implements panel not showing any results.
- this is not a clean fix, it only improves the situation by making the
wizzard actually usable
- logic should not use Class.forName since it doesn't know anything
about the opened projects or used JDKs
- proper fix would either require calling ElementHandle.resolve off
EDT and getting CompiltaionInfo from somewhere or to add modifiers
to ElementHandle itself which would be a fairly large change
---
.../java/project/ui/ExtensionAndImplementationVisualPanel.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/java/java.project.ui/src/org/netbeans/modules/java/project/ui/ExtensionAndImplementationVisualPanel.java b/java/java.project.ui/src/org/netbeans/modules/java/project/ui/ExtensionAndImplementationVisualPanel.java
index fd856fa..d9854e3 100644
--- a/java/java.project.ui/src/org/netbeans/modules/java/project/ui/ExtensionAndImplementationVisualPanel.java
+++ b/java/java.project.ui/src/org/netbeans/modules/java/project/ui/ExtensionAndImplementationVisualPanel.java
@@ -240,14 +240,15 @@ public class ExtensionAndImplementationVisualPanel extends JPanel implements Doc
}
private boolean isNotFinalExceptionType(ElementHandle<TypeElement> typeHandle) {
+ // TODO: this should not use Class.forName!
try {
Class<?> clazz = Class.forName(typeHandle.getQualifiedName());
return typeHandle.getKind() == ElementKind.CLASS
&& Exception.class.isAssignableFrom(clazz)
&& !Modifier.isFinal(clazz.getModifiers());
} catch (ClassNotFoundException ex) {
+ return true; // we don't know
}
- return false;
}
private boolean isInterface(ElementHandle<TypeElement> typeHandle) {
@@ -255,12 +256,13 @@ public class ExtensionAndImplementationVisualPanel extends JPanel implements Doc
}
private boolean isNotFinalClass(ElementHandle<TypeElement> typeHandle) {
+ // TODO: this should not use Class.forName!
try {
Class<?> clazz = Class.forName(typeHandle.getQualifiedName());
return typeHandle.getKind() == ElementKind.CLASS && !Modifier.isFinal(clazz.getModifiers());
} catch (ClassNotFoundException ex) {
+ return true; // we don't know
}
- return false;
}
private void browseInterfacesButtonActionPerformed(ActionEvent evt) {
---------------------------------------------------------------------
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