[hg] main-silver: #232345: added logging

  • From: Svata Dedic < >
  • To:
  • Subject: [hg] main-silver: #232345: added logging
  • Date: Wed, 10 Jul 2013 23:36:13 -0700

changeset 25a8c64007b1 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/25a8c64007b1
description:
        #232345: added logging

diffstat:

 
editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
 |   4 +
 editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java      
      |  22 ++++++---
 2 files changed, 18 insertions(+), 8 deletions(-)

diffs (58 lines):

diff --git 
a/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
 
b/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
--- 
a/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
+++ 
b/editor.fold/src/org/netbeans/modules/editor/fold/FoldHierarchyTransactionImpl.java
@@ -335,6 +335,10 @@
                         LOG.warning("Document event was: " + evt + " offset: 
" + insertOffset + ", len: " + evt.getLength());
                     }
                     api.foldStateChangeEndOffsetChanged(state, 
childFoldEndOffset);
+                    if (fold.getStartOffset() > fold.getEndOffset()) {
+                        LOG.warning("Updated fold is inconsistent, dumping 
fold hierarchy: " + execution);
+                        LOG.warning("Document event was: " + evt + " offset: 
" + insertOffset + ", len: " + evt.getLength());
+                    }
                     
                 } else { // not right at the end of the fold -> check damaged
                     int dmg = 
FoldUtilitiesImpl.isFoldDamagedByInsert(childFold, evt);
diff --git 
a/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java 
b/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
--- a/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
+++ b/editor.fold/src/org/netbeans/modules/editor/fold/FoldOperationImpl.java
@@ -679,26 +679,32 @@
         
         public Fold update(Fold f, FoldInfo info) throws 
BadLocationException {
             this.fsch = null;
-            int offs = f.getStartOffset();
+            int soffs = f.getStartOffset();
             ApiPackageAccessor acc = getAccessor();
-            if (info.getStart() != offs) {
+            if (info.getStart() != soffs) {
                 acc.foldSetStartOffset(f, getDocument(), info.getStart());
                 FoldStateChange state = getFSCH(f);
-                if (state.getOriginalEndOffset() >= 0 && 
state.getOriginalEndOffset() < offs) {
+                if (state.getOriginalEndOffset() >= 0 && 
state.getOriginalEndOffset() < soffs) {
                     LOG.warning("Original start offset > end offset, dumping 
fold hierarchy: " + execution);
                     LOG.warning("FoldInfo: " + info + ", fold: " + f);
                 }
-                acc.foldStateChangeStartOffsetChanged(state, offs);
+                acc.foldStateChangeStartOffsetChanged(state, soffs);
+                soffs = info.getStart();
             }
-            offs = f.getEndOffset();
-            if (info.getEnd() != offs) {
+            int eoffs = f.getEndOffset();
+            if (info.getEnd() != eoffs) {
                 FoldStateChange state = getFSCH(f);
-                if (state.getOriginalStartOffset()>= 0 && 
state.getOriginalStartOffset() > offs) {
+                if (state.getOriginalStartOffset()>= 0 && 
state.getOriginalStartOffset() > eoffs) {
                     LOG.warning("Original end offset < start offset, dumping 
fold hierarchy: " + execution);
                     LOG.warning("FoldInfo: " + info + ", fold: " + f);
                 }
                 acc.foldSetEndOffset(f, getDocument(), info.getEnd());
-                acc.foldStateChangeEndOffsetChanged(state, offs);
+                acc.foldStateChangeEndOffsetChanged(state, eoffs);
+                eoffs = info.getEnd();
+            }
+            if (soffs > eoffs) {
+                LOG.warning("Updated end offset < start offset, dumping fold 
hierarchy: " + execution);
+                LOG.warning("FoldInfo: " + info + ", fold: " + f);
             }
             String desc = info.getDescriptionOverride();
             if (desc == null) {

[hg] main-silver: #232345: added logging

Svata Dedic 07/11/2013

Project Features

About this Project

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