From 95bab486a0dfa53521cec4be70ad2d5a7c96de5a Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 10 Nov 2010 16:17:59 +0300 Subject: [PATCH] cleanup --- .../impl/quickfix/CreateConstructorFromThisOrSuperFix.java | 2 +- .../daemon/impl/quickfix/CreateMethodFromUsageFix.java | 2 +- .../src/com/intellij/codeInsight/CodeInsightUtilBase.java | 2 +- .../com/intellij/codeInsight/daemon/impl/FileStatusMap.java | 6 +++--- .../codeInsight/template/impl/TemplateSegments.java | 2 +- .../com/intellij/injected/editor/DocumentWindowImpl.java | 2 +- .../com/intellij/openapi/editor/impl/CaretModelImpl.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java index 915be6fad966..feef7fce0cda 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java @@ -98,7 +98,7 @@ public abstract class CreateConstructorFromThisOrSuperFix extends CreateFromUsag targetClass = constructor.getContainingClass(); myMethodCall = CodeInsightUtil.findElementInRange(psiFile, rangeMarker.getStartOffset(), rangeMarker.getEndOffset(), myMethodCall.getClass()); - ((RangeMarkerEx)rangeMarker).dispose(); + rangeMarker.dispose(); Template template = templateBuilder.buildTemplate(); final Editor editor = positionCursor(project, targetClass.getContainingFile(), targetClass); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java index efd87ce80e6f..02870ac48ecc 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java @@ -229,7 +229,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix { Template template = builder.buildTemplate(); newEditor.getCaretModel().moveToOffset(rangeMarker.getStartOffset()); newEditor.getDocument().deleteString(rangeMarker.getStartOffset(), rangeMarker.getEndOffset()); - ((RangeMarkerEx)rangeMarker).dispose(); + rangeMarker.dispose(); if (!shouldBeAbstract) { startTemplate(newEditor, template, project, new TemplateEditingAdapter() { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightUtilBase.java b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightUtilBase.java index f51bc212edd8..2c3e9fa0f14b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightUtilBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/CodeInsightUtilBase.java @@ -85,7 +85,7 @@ public class CodeInsightUtilBase { T elementInRange = findElementInRange(psiFile, rangeMarker.getStartOffset(), rangeMarker.getEndOffset(), (Class)element.getClass(), language); - ((RangeMarkerEx)rangeMarker).dispose(); + rangeMarker.dispose(); return elementInRange; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java index 9b50ebd65e0f..d89fb0377d99 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/FileStatusMap.java @@ -171,7 +171,7 @@ public class FileStatusMap implements Disposable { else if (status.dirtyScopes.containsKey(passId)) { RangeMarker marker = status.dirtyScopes.get(passId); if (marker != null) { - ((RangeMarkerEx)marker).dispose(); + marker.dispose(); status.dirtyScopes.put(passId, null); } } @@ -217,7 +217,7 @@ public class FileStatusMap implements Disposable { LOG.assertTrue(status.dirtyScopes.containsKey(passId)); RangeMarker marker = status.dirtyScopes.get(passId); if (marker != null) { - ((RangeMarkerEx)marker).dispose(); + marker.dispose(); } marker = document.createRangeMarker(0, document.getTextLength()); status.dirtyScopes.put(passId, marker); @@ -269,7 +269,7 @@ public class FileStatusMap implements Disposable { if (union.getEndOffset() > textLength) { union = union.intersection(new TextRange(0, textLength)); } - ((RangeMarkerEx)old).dispose(); + old.dispose(); return document.createRangeMarker(union); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSegments.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSegments.java index 48b022d846dd..abb26c704eba 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSegments.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSegments.java @@ -73,7 +73,7 @@ public class TemplateSegments { public void replaceSegmentAt(int index, int start, int end) { RangeMarker rangeMarker = mySegments.get(index); - ((RangeMarkerEx)rangeMarker).dispose(); + rangeMarker.dispose(); Document doc = myEditor.getDocument(); rangeMarker = doc.createRangeMarker(start, end); rangeMarker.setGreedyToLeft(true); diff --git a/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java b/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java index ea2d87e29d38..c4cb198940af 100644 --- a/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java +++ b/platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java @@ -758,7 +758,7 @@ public class DocumentWindowImpl extends UserDataHolderBase implements Disposable public void dispose() { for (PsiLanguageInjectionHost.Shred shred : myShreds) { RangeMarker rangeMarker = shred.getHostRangeMarker(); - ((RangeMarkerEx)rangeMarker).dispose(); + rangeMarker.dispose(); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java index 4608f9b53834..72f79aad4f61 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java @@ -87,7 +87,7 @@ public class CaretModelImpl implements CaretModel, PrioritizedDocumentListener, private void releaseBulkCaretMarker() { if (savedBeforeBulkCaretMarker != null) { - ((RangeMarkerEx)savedBeforeBulkCaretMarker).dispose(); + savedBeforeBulkCaretMarker.dispose(); savedBeforeBulkCaretMarker = null; } }