[hg] main-silver: Additional diagnostics - see issue #222763.

  • From: Dusan Balek < >
  • To: ,
  • Subject: [hg] main-silver: Additional diagnostics - see issue #222763.
  • Date: Thu, 06 Dec 2012 11:30:32 -0800

changeset e4be6e4fd5c6 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/e4be6e4fd5c6
description:
        Additional diagnostics - see issue #222763.

diffstat:

 editor/src/org/netbeans/modules/editor/NbEditorDocument.java                 
     |   1 +
 
java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
 |  16 +++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (37 lines):

diff --git a/editor/src/org/netbeans/modules/editor/NbEditorDocument.java 
b/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
--- a/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
+++ b/editor/src/org/netbeans/modules/editor/NbEditorDocument.java
@@ -154,6 +154,7 @@
                 return null;
             }
         });
+        putProperty("Issue-222763-debug", new Exception()); // Issue #222763 
debugging - to be removed soon
     }
 
     public @Override int getShiftWidth() {
diff --git 
a/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
 
b/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
--- 
a/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
+++ 
b/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
@@ -364,7 +364,21 @@
                 insideRender = true;
                 Document d = 
operation.getHierarchy().getComponent().getDocument();
                 if (d != doc) {
-                    throw new IllegalStateException("Different documents 
used for folds computation and commit.\nDocument used for computation:" + doc 
+ "\nDocument used for commit:" + d); //NOI18N
+                    StringBuilder dSB = new StringBuilder();
+                    Exception de = (Exception) 
d.getProperty("Issue-222763-debug"); //NOI18N
+                    if (de != null) {
+                        for (StackTraceElement trace : de.getStackTrace()) {
+                            dSB.append("\tat ").append(trace).append('\n'); 
//NOI18N
+                        }
+                    }
+                    StringBuilder docSB = new StringBuilder();
+                    de = (Exception) doc.getProperty("Issue-222763-debug"); 
//NOI18N
+                    if (de != null) {
+                        for (StackTraceElement trace : de.getStackTrace()) {
+                            docSB.append("\tat 
").append(trace).append('\n'); //NOI18N
+                        }
+                    }
+                    throw new IllegalStateException("Different documents 
used for folds computation and commit.\nDocument used for computation:" + doc 
+ "\ncreated:\n" + docSB.toString() + "\nDocument used for commit:" + d + 
"\ncreated:\n" + dSB.toString()); //NOI18N
                 }
                 d.render(this);
                 

[hg] main-silver: Additional diagnostics - see issue #222763.

Dusan Balek 12/06/2012

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close