lkishalmi closed pull request #995: [NETBEANS-1419] fix for Assertion Error
while editing project libraries
URL: https://github.com/apache/incubator-netbeans/pull/995
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/platform/openide.awt/src/org/openide/awt/HtmlRendererImpl.java
b/platform/openide.awt/src/org/openide/awt/HtmlRendererImpl.java
index c199a68360..010580382a 100644
--- a/platform/openide.awt/src/org/openide/awt/HtmlRendererImpl.java
+++ b/platform/openide.awt/src/org/openide/awt/HtmlRendererImpl.java
@@ -75,7 +75,7 @@
/** Restore the renderer to a pristine state */
public void reset() {
- assert SwingUtilities.isEventDispatchThread();
+ assertEDTAccess();
parentFocused = false;
setCentered(false);
html = null;
@@ -750,4 +750,21 @@ private static final Graphics scratchGraphics() {
super.addPropertyChangeListener(l);
}
}
+
+ private void assertEDTAccess() {
+ boolean check = false;
+ assert check = true;
+ if (check && !SwingUtilities.isEventDispatchThread() &&
System.getProperty("nbjunit.workdir") == null) {
+ StackTraceElement[] stackTrace =
Thread.currentThread().getStackTrace();
+ boolean whitespaced = false;
+ for (int i = 0; i < stackTrace.length; ++i) {
+ StackTraceElement elem = stackTrace[i];
+ if
("org.openide.explorer.view.TreeView".equals(elem.getClassName()) &&
"<init>".equals(elem.getMethodName())) {
+ whitespaced = true;
+ break;
+ }
+ }
+ assert whitespaced || SwingUtilities.isEventDispatchThread() :
"Should be called in EDT only!";
+ }
+ }
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists