some more assertions
[idea/community.git] / platform / core-impl / src / com / intellij / psi / impl / smartPointers / MarkerCache.java
index 018bd8c12e86cdd8bcdaf34ecd64a9cb46b76a06..05bc1cf7261e7d3b45f45e2cd7bcfd9bbb50ed3f 100644 (file)
@@ -107,15 +107,15 @@ class MarkerCache {
     for (DocumentEvent event : events) {
       final FrozenDocument before = frozen;
       final DocumentEvent corrected;
     for (DocumentEvent event : events) {
       final FrozenDocument before = frozen;
       final DocumentEvent corrected;
-      if ((event instanceof RetargetRangeMarkers)) {
+      if (event instanceof RetargetRangeMarkers) {
         RetargetRangeMarkers retarget = (RetargetRangeMarkers)event;
         corrected = new RetargetRangeMarkers(frozen, retarget.getStartOffset(), retarget.getEndOffset(), retarget.getMoveDestinationOffset());
       }
       else {
         RetargetRangeMarkers retarget = (RetargetRangeMarkers)event;
         corrected = new RetargetRangeMarkers(frozen, retarget.getStartOffset(), retarget.getEndOffset(), retarget.getMoveDestinationOffset());
       }
       else {
-        frozen = frozen.applyEvent(event, 0);
         corrected = new DocumentEventImpl(frozen, event.getOffset(), event.getOldFragment(), event.getNewFragment(), event.getOldTimeStamp(),
                                           event.isWholeTextReplaced(),
                                           ((DocumentEventImpl) event).getInitialStartOffset(), ((DocumentEventImpl) event).getInitialOldLength());
         corrected = new DocumentEventImpl(frozen, event.getOffset(), event.getOldFragment(), event.getNewFragment(), event.getOldTimeStamp(),
                                           event.isWholeTextReplaced(),
                                           ((DocumentEventImpl) event).getInitialStartOffset(), ((DocumentEventImpl) event).getInitialOldLength());
+        frozen = frozen.applyEvent(event, 0);
       }
 
       int i = 0;
       }
 
       int i = 0;