redundant casts: cleanup
authoranna <anna.kozlova@jetbrains.com>
Thu, 23 Jun 2011 13:02:44 +0000 (17:02 +0400)
committeranna <anna.kozlova@jetbrains.com>
Thu, 23 Jun 2011 13:04:08 +0000 (17:04 +0400)
62 files changed:
java/compiler/impl/src/com/intellij/compiler/impl/ModuleCompileScope.java
java/debugger/impl/src/com/intellij/debugger/actions/RemoveWatchAction.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTableModel.java
java/idea-ui/src/com/intellij/ide/util/newProjectWizard/SupportForFrameworksStep.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaDocCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodQuickFix.java
java/java-impl/src/com/intellij/codeInspection/reference/RefFieldImpl.java
java/java-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java
java/java-impl/src/com/intellij/codeInspection/reference/RefJavaFileImpl.java
java/java-impl/src/com/intellij/codeInspection/sameReturnValue/SameReturnValueInspection.java
java/java-impl/src/com/intellij/ide/scopeView/nodes/ClassNode.java
java/java-impl/src/com/intellij/psi/impl/source/PsiFieldImpl.java
java/java-impl/src/com/intellij/slicer/SliceUtil.java
java/java-tests/testSrc/com/intellij/projectView/SameNamesJoiner.java
java/openapi/src/com/intellij/psi/PsiPrimitiveType.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/InspectionProfileConvertor.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TableSorter.java
platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorComposer.java
platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
platform/lang-impl/src/com/intellij/extapi/psi/StubBasedPsiElementBase.java
platform/lang-impl/src/com/intellij/refactoring/BaseRefactoringProcessor.java
platform/lang-impl/src/com/intellij/refactoring/classMembers/UsedByMemberDependencyGraph.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/incrementalMerge/ConflictChange.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/incrementalMerge/ui/MergePanel2.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java
platform/platform-impl/src/com/intellij/ui/content/impl/ContentManagerImpl.java
platform/platform-impl/src/com/intellij/ui/plaf/beg/IdeaMenuUI.java
platform/platform-impl/src/com/intellij/util/IJSwingUtilities.java
platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PathsVerifier.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListWorker.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/IgnoredFilesCompositeHolder.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/BooleanFieldAlwaysNegatedInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/MethodReturnAlwaysConstantInspection.java
plugins/ant/src/com/intellij/lang/ant/config/impl/AntConfigurationImpl.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/changeBrowser/CvsCommittedChangesProvider.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/ui/experts/importToCvs/CustomizeKeywordSubstitutionStep.java
plugins/git4idea/src/git4idea/diff/GitDiffProvider.java
plugins/git4idea/src/git4idea/history/browser/CaptionIcon.java
plugins/git4idea/src/git4idea/history/wholeTree/BasePopupAction.java
plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/SuppressForMemberFix.java
plugins/groovy/src/org/jetbrains/plugins/groovy/dsl/dsltop/GroovyDslDefaultMembers.java
plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/control/MergeIfAndPredicate.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/changeSignature/GrChangeSignatureUsageProcessor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/field/GrIntroduceFieldHandler.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/introduce/variable/GroovyIntroduceVariableBase.java
plugins/java-i18n/src/com/intellij/lang/properties/UnusedMessageFormatParameterInspection.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenUIModifiableModelsProvider.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManagerWatcher.java
plugins/properties/src/com/intellij/lang/properties/structureView/PropertiesStructureViewElement.java
plugins/svn4idea/src/org/jetbrains/idea/svn/actions/MarkLocallyDeletedTreeConflictResolvedAction.java
plugins/svn4idea/src/org/jetbrains/idea/svn/checkin/SvnCheckinEnvironment.java
plugins/svn4idea/src/org/jetbrains/idea/svn/config/SvnConfigureProxiesComponent.java
plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java
plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java
plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/Painter.java
xml/dom-openapi/src/com/intellij/util/xml/ui/BasicDomElementComponent.java
xml/impl/src/com/intellij/codeInsight/completion/DtdCompletionData.java
xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/InsertRequiredAttributeFix.java
xml/impl/src/com/intellij/lang/xml/XmlStructureViewBuilderFactory.java
xml/impl/src/com/intellij/psi/impl/source/xml/SchemaPrefixReference.java

index 3e74ea330d8482fb68ef2dc288e5e6fff3097381..3be5efc00fb0e20bab6e7495d323a7bc57dd983f 100644 (file)
@@ -92,8 +92,7 @@ public class ModuleCompileScope extends FileIndexCompileScope {
   protected FileIndex[] getFileIndices() {
     final FileIndex[] indices = new FileIndex[myScopeModules.size()];
     int idx = 0;
-    for (final Module myScopeModule : myScopeModules) {
-      final Module module = (Module)myScopeModule;
+    for (final Module module : myScopeModules) {
       indices[idx++] = ModuleRootManager.getInstance(module).getFileIndex();
     }
     return indices;
index 0c2e7e7174bb2e85515e32ffe10c26ea94afc77b..322241943357998442bb0982e0e48499c54eaba4 100644 (file)
@@ -35,7 +35,7 @@ public class RemoveWatchAction extends DebuggerAction {
       }
     }
 
-    return (DebuggerTreeNodeImpl[])selectedWatches.toArray(new DebuggerTreeNodeImpl[selectedWatches.size()]);
+    return selectedWatches.toArray(new DebuggerTreeNodeImpl[selectedWatches.size()]);
   }
 
   public void actionPerformed(AnActionEvent e) {
index b38a84bc96a64fcf834813d31c92ef638c819b8d..6999260ec9df219febae2dbeffa91e2b34d1737d 100644 (file)
@@ -112,7 +112,7 @@ public class BreakpointTableModel extends AbstractTableModel implements ItemRemo
   }
 
   public Object getValueAt(int rowIndex, int columnIndex) {
-    Breakpoint breakpoint = (Breakpoint)myBreakpoints.get(rowIndex);
+    Breakpoint breakpoint = myBreakpoints.get(rowIndex);
     if (columnIndex == NAME) {
       return breakpoint.getDisplayName();
     }
index f73d24215f89f7ac7ed6460b274206c7b77dbaff..4faf41f8e7dabfebea2d31d79bb7b1714601dffb 100644 (file)
@@ -51,7 +51,7 @@ public class SupportForFrameworksStep extends ModuleWizardStep {
   private static String getBaseDirectory(final ModuleBuilder builder) {
     String path = null;
     if (builder instanceof JavaModuleBuilder) {
-      path = ((JavaModuleBuilder)builder).getContentEntryPath();
+      path = builder.getContentEntryPath();
     }
     if (path == null) {
       path = builder.getModuleFileDirectory();
index abc1425bdac8d28c7bb8e74b603b7f1125d813fc..0944065814151db95f380227230f62eca6635632 100644 (file)
@@ -205,7 +205,7 @@ public class JavaDocCompletionContributor extends CompletionContributor {
       }
       PsiDocumentManager.getInstance(context.getProject()).commitDocument(context.getEditor().getDocument());
       final Editor editor = context.getEditor();
-      final PsiMethod method = (PsiMethod)((LookupItem)item).getObject();
+      final PsiMethod method = (PsiMethod)item.getObject();
 
       final PsiParameter[] parameters = method.getParameterList().getParameters();
       final StringBuffer buffer = new StringBuffer();
index cd970279c252b7fbfc4351d9dd01f229eed43fb0..ca1c6e2cf8428f82c553da0f0e74a4a80aeb87bb 100644 (file)
@@ -70,7 +70,7 @@ public class CreateMethodQuickFix implements LocalQuickFix {
         }
       });
 
-    method = (PsiMethod)JavaCodeStyleManager.getInstance(project).shortenClassReferences((PsiMethod)myTargetClass.add(method));
+    method = (PsiMethod)JavaCodeStyleManager.getInstance(project).shortenClassReferences(myTargetClass.add(method));
     CreateMethodFromUsageFix.doCreate(myTargetClass, method, arguments, PsiSubstitutor.EMPTY, ExpectedTypeInfo.EMPTY_ARRAY, method);
   }
 
index 19aac9baeb0631f03c4938d4b82662f4844660b9..eaa59ffbee2d16db707f6603c30d494c79270336 100644 (file)
@@ -69,7 +69,7 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
     if (forReading) {
       setUsedForReading(true);
     }
-    ((RefManagerImpl)getRefManager()).fireNodeMarkedReferenced(this, refFrom, referencedFromClassInitializer, forReading, forWriting);
+    getRefManager().fireNodeMarkedReferenced(this, refFrom, referencedFromClassInitializer, forReading, forWriting);
   }
 
   public boolean isUsedForReading() {
@@ -138,7 +138,7 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
         }
 
       }
-      ((RefManagerImpl)getRefManager()).fireBuildReferences(this);
+      getRefManager().fireBuildReferences(this);
     }
   }
 
@@ -187,6 +187,6 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
   }
 
   protected void initialize() {
-    ((RefManagerImpl)getRefManager()).fireNodeInitialized(this);
+    getRefManager().fireNodeInitialized(this);
   }
 }
index 41c63b6a26171fd08221f3264595a6cb3bd46343..69d65c5a5e16b7cf111a61aebbeb4323535f78d2 100644 (file)
@@ -38,7 +38,7 @@ public class RefImplicitConstructorImpl extends RefMethodImpl implements RefImpl
   }
 
   public void buildReferences() {
-    ((RefManagerImpl)getRefManager()).fireBuildReferences(this);
+    getRefManager().fireBuildReferences(this);
   }
 
   public boolean isSuspicious() {
index ff6166d909882dee5ab0bececf0ba1423cf6a85f..9bfd6f01c07d23aac47859f55b117362f7d5b386 100644 (file)
@@ -25,6 +25,6 @@ import com.intellij.psi.PsiJavaFile;
 public class RefJavaFileImpl extends RefFileImpl {
   RefJavaFileImpl(PsiJavaFile elem, RefManager manager) {
     super(elem, manager);
-    ((RefPackageImpl)getRefManager().getExtension(RefJavaManager.MANAGER).getPackage(((PsiJavaFile)elem).getPackageName())).add(this);
+    ((RefPackageImpl)getRefManager().getExtension(RefJavaManager.MANAGER).getPackage(elem.getPackageName())).add(this);
   }
 }
\ No newline at end of file
index db40b99a0cba8b2fb8368cd5bfe53ae2e7d05538..fd5f622561d8e8355a6c6f3c9e09f2cf457ad3dd 100644 (file)
@@ -47,7 +47,7 @@ public class SameReturnValueInspection extends GlobalJavaInspectionTool {
           message = InspectionsBundle.message("inspection.same.return.value.problem.descriptor2", "<code>" + returnValue + "</code>");
         }
 
-        return new ProblemDescriptor[] {manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, false, (LocalQuickFix [])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)};
+        return new ProblemDescriptor[] {manager.createProblemDescriptor(refMethod.getElement().getNavigationElement(), message, false, null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)};
       }
     }
 
index 6789a8ce8bd32c390e56c52613d89acb6269854a..9cbcabaf759e7509dacf0f4bfc2224030ea52206 100644 (file)
@@ -40,6 +40,6 @@ public class ClassNode extends BasePsiNode<PsiClass> implements Comparable<Class
   }
 
   public int compareTo(final ClassNode o) {
-    return ClassTreeNode.getClassPosition((PsiClass)getPsiElement()) - ClassTreeNode.getClassPosition((PsiClass)((ClassNode)o).getPsiElement());
+    return ClassTreeNode.getClassPosition((PsiClass)getPsiElement()) - ClassTreeNode.getClassPosition((PsiClass)o.getPsiElement());
   }
 }
index a56d610ca9c5dcd4e4d1629f43b9b617dd64783f..6b998d6eec2e5985dee7ad34fc8d000c62755bb9 100644 (file)
@@ -372,15 +372,15 @@ public class PsiFieldImpl extends JavaStubPsiElement<PsiFieldStub> implements Ps
       if (nextField == null || nextField.getElementType() != JavaElementType.FIELD) break;
 
       TreeElement semicolon = Factory.createSingleLeafElement(JavaTokenType.SEMICOLON, ";", 0, 1, null, getManager());
-      CodeEditUtil.addChild((CompositeElement)field, semicolon, null);
+      CodeEditUtil.addChild(field, semicolon, null);
 
-      CodeEditUtil.removeChild((CompositeElement)comma.getTreeParent(), comma);
+      CodeEditUtil.removeChild(comma.getTreeParent(), comma);
 
       PsiElement typeClone = type.copy();
-      CodeEditUtil.addChild((CompositeElement)nextField, SourceTreeToPsiMap.psiElementToTree(typeClone), nextField.getFirstChildNode());
+      CodeEditUtil.addChild(nextField, SourceTreeToPsiMap.psiElementToTree(typeClone), nextField.getFirstChildNode());
 
       PsiElement modifierListClone = modifierList.copy();
-      CodeEditUtil.addChild((CompositeElement)nextField, SourceTreeToPsiMap.psiElementToTree(modifierListClone), nextField.getFirstChildNode());
+      CodeEditUtil.addChild(nextField, SourceTreeToPsiMap.psiElementToTree(modifierListClone), nextField.getFirstChildNode());
 
       field = nextField;
     }
index 7080ea7a034cef74c6658b0d6eb90776b2b71806..6d87cd6b331f8019416e62c59127abc8d81105b7 100644 (file)
@@ -128,7 +128,7 @@ public class SliceUtil {
                                          @NotNull SliceUsage parent,
                                          @NotNull PsiSubstitutor substitutor) {
     final PsiExpression realExpression =
-      exp.getParent() instanceof DummyHolder ? (PsiExpression)((DummyHolder)exp.getParent()).getContext() : exp;
+      exp.getParent() instanceof DummyHolder ? (PsiExpression)exp.getParent().getContext() : exp;
     assert realExpression != null;
     if (!(realExpression instanceof PsiCompiledElement)) {
       SliceUsage usage = createSliceUsage(realExpression, parent, substitutor);
index 1c87b5970ce09cfc6a5577d0b75064d2e0b2d79e..a9efd3480a30c58751a9c731491043751ec7f0bd 100644 (file)
@@ -69,7 +69,7 @@ class SameNamesJoiner implements TreeStructureProvider {
   }
 
   private boolean hasElementWithTheSameName(PsiFile element) {
-    PsiDirectory psiDirectory = ((PsiDirectory)element.getParent());
+    PsiDirectory psiDirectory = element.getParent();
     PsiElement[] children = psiDirectory.getChildren();
     for (int i = 0; i < children.length; i++) {
       PsiElement child = children[i];
index bd5693b05c927a8d4418d5011127af53371f4094..84fa371ce2fc76c263ee35b109e3e0e9a77346d1 100644 (file)
@@ -99,7 +99,7 @@ public class PsiPrimitiveType extends PsiType {
     if (!((PsiClassType)type).getLanguageLevel().hasEnumKeywordAndAutoboxing()) return null;
     final PsiClass psiClass = ((PsiClassType)type).resolve();
     if (psiClass == null) return null;
-    return (PsiPrimitiveType)ourQNameToUnboxed.get(psiClass.getQualifiedName());
+    return ourQNameToUnboxed.get(psiClass.getQualifiedName());
   }
 
   public String getBoxedTypeName() {
index 9909a3dfb5fd7d31209bf875a81f8b0e82c1206b..3feee6ca8a9732f3df113db63b1749611df67851 100644 (file)
@@ -174,7 +174,7 @@ public class InspectionProfileConvertor {
 
       //set up tools for default profile
       if (level != HighlightDisplayLevel.DO_NOT_SHOW) {
-        profile.enableTool(shortName, (NamedScope)null);
+        profile.enableTool(shortName, null);
       }
 
       if (level == null || level == HighlightDisplayLevel.DO_NOT_SHOW) {
index 2deb038c3e0b81ed64763c430306b484101c14f0..b68a53fb894be05b4cc986ff34dd280285feda07 100644 (file)
@@ -228,7 +228,7 @@ public class TableSorter extends TableMap {
     compares = 0;
     // n2sort();
     // qsort(0, indexes.length-1);
-    shuttlesort((int[])indexes.clone(), indexes, 0, indexes.length);
+    shuttlesort(indexes.clone(), indexes, 0, indexes.length);
     //System.out.println("Compares: "+compares);
   }
 
index acfebad2616a05941cbe3d8dda0d1171be4af3d5..8e3b053f035749fda42add2aa96e902794741ce7 100644 (file)
@@ -98,7 +98,7 @@ public class DescriptorComposer extends HTMLComposerImpl {
 
     composeDescription(descriptor, problemIdx, buf, refElement);
 
-    if (refElement instanceof RefElement && !((RefElement)refElement).isValid()) return;
+    if (refElement instanceof RefElement && !refElement.isValid()) return;
 
     final QuickFix[] fixes = descriptor.getFixes();
     if (fixes != null && fixes.length > 0) {
index ab2add867638e20a3747abca1455b7400f75cb3e..631e7815f049c1ffd4441a3f37f6eaa80d954f59 100644 (file)
@@ -890,7 +890,7 @@ public class ConsoleViewImpl extends JPanel implements ConsoleView, ObservableCo
       int oEnd = CharArrayUtil.shiftBackward(chars, document.getLineEndOffset(lEnd) - 1, " \t") + 1;
 
       FoldRegion region =
-        ((FoldingModelEx)myEditor.getFoldingModel()).createFoldRegion(oStart, oEnd, prevFolding.getPlaceholderText(toFold), null, false);
+        myEditor.getFoldingModel().createFoldRegion(oStart, oEnd, prevFolding.getPlaceholderText(toFold), null, false);
       if (region != null) {
         toAdd.add(region);
       }
index 8af2b11be60d332d46db425cbe9b2e6b3abe0ee6..0e5f206cdd063698dd13278896bf4bb938113ad3 100644 (file)
@@ -117,7 +117,7 @@ public class StubBasedPsiElementBase<T extends StubElement> extends ASTDelegateP
       while (!(stub instanceof PsiFileStub)) {
         stub = stub.getParentStub();
       }
-      return (PsiFile)((PsiFileStub)stub).getPsi();
+      return (PsiFile)stub.getPsi();
     }
 
     return super.getContainingFile();
index 25ebed2c5b927d364dc1db8485cdd8c14eaaf3c5..b9dc74f9a0fac303c2e022362018369309b42e67 100644 (file)
@@ -308,7 +308,7 @@ public abstract class BaseRefactoringProcessor {
         }
         if (usage instanceof UsageInfo2UsageAdapter) {
           final UsageInfo usageInfo = ((UsageInfo2UsageAdapter)usage).getUsageInfo();
-          if (usageInfo instanceof MoveRenameUsageInfo && ((MoveRenameUsageInfo)usageInfo).isDynamicUsage()) {
+          if (usageInfo instanceof MoveRenameUsageInfo && usageInfo.isDynamicUsage()) {
             dynamicUsagesCount++;
             dynamicUsagesCodeFiles.add(containingFile);
           }
index d3663ba8075fdcd4c9755f04bb11bd3804d81eab..da1991bc451f23611b082782cdbf4b8dc71bd3ae 100644 (file)
@@ -104,7 +104,7 @@ public class UsedByMemberDependencyGraph<T extends NavigatablePsiElement, C exte
     ArrayList<String> strings = new ArrayList<String>();
     for (T dep : dependencies) {
       if (dep instanceof PsiNamedElement) {
-        strings.add(((PsiNamedElement)dep).getName());
+        strings.add(dep.getName());
       }
     }
 
index f7a8f6e2a563136d2c4e1e50bfbdecd5239d7767..8fc7f10ccce13348e29487c5903b6a34b0e72c31 100644 (file)
@@ -34,7 +34,7 @@ class ConflictChange extends Change implements DiffRangeMarker.RangeInvalidListe
   }
 
   public ChangeType.ChangeSide getChangeSide(FragmentSide side) {
-    return isBranch(side) ? myOriginalSide : (ChangeType.ChangeSide)myConflict;
+    return isBranch(side) ? myOriginalSide : myConflict;
   }
 
   private boolean isBranch(FragmentSide side) {
index bf1228f933afc2a4e1509afaaf3171505b7d2e5f..f7a85dc1e0e70509f24600225d58564179a91ca3 100644 (file)
@@ -380,7 +380,7 @@ public class MergePanel2 implements DiffViewer {
       if (myIndex == 0) editor.setVerticalScrollbarOrientation(EditorEx.VERTICAL_SCROLLBAR_LEFT);
       if (myIndex != 1) ((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);
       editor.getSettings().setFoldingOutlineShown(false);
-      ((FoldingModelEx)editor.getFoldingModel()).setFoldingEnabled(false);
+      editor.getFoldingModel().setFoldingEnabled(false);
       HashSet<EditorPlace.ViewProperty> notProcessedDefaults = new HashSet<EditorPlace.ViewProperty>(ALL_PROPERTIES);
       for (EditorPlace.ViewProperty viewProperty : myProperties.keySet()) {
         notProcessedDefaults.remove(viewProperty);
index 9b08925a7be2ecba1b486f95a0eadbac07618546..350775186174c3f57ab8973bc7ea83dd833b2fb6 100644 (file)
@@ -566,7 +566,7 @@ public final class WindowManagerImpl extends WindowManagerEx implements Applicat
       myProject2Frame.put(null, frame);
     }
     else {
-      Disposer.dispose((StatusBarEx) frame.getStatusBar());
+      Disposer.dispose(frame.getStatusBar());
       frame.dispose();
     }
   }
index 4dc9b4e0daa5bcca7808fe6367266c6905b5f431..eb80961119fa585021533180876b611d39e2248f 100644 (file)
@@ -1220,7 +1220,7 @@ public class BalloonImpl implements Disposable, Balloon, LightweightWindow, Posi
             Container parent = myCloseRec.getParent();
             parent.remove(myCloseRec);
             ((JComponent)parent).revalidate();
-            ((JComponent)parent).repaint();
+            parent.repaint();
           }
         }
       });
index f47c0df6739ffb1558d4b5493bf9ffe2e9f3e26d..2228686e41488bda93b1a03239bc7544cb342165 100644 (file)
@@ -157,7 +157,7 @@ public class ContentManagerImpl implements ContentManager, PropertyChangeListene
 
     public JComponent getComponent() {
       if (myUI instanceof SwitchProvider) {
-        return ((SwitchProvider)myUI).getComponent();
+        return myUI.getComponent();
       }
 
       return this;
index f1dfa037ea6b7b58ea7d9f3d82d7e8c6b3e526cd..0cab512f282b5d8885076e06b9e0a6e513b80f8b 100644 (file)
@@ -73,7 +73,7 @@ public class IdeaMenuUI extends BasicMenuUI{
 
   protected void installDefaults() {
     super.installDefaults();
-    Integer integer = (Integer)UIUtil.getPropertyMaxGutterIconWidth(getPropertyPrefix());
+    Integer integer = UIUtil.getPropertyMaxGutterIconWidth(getPropertyPrefix());
     if (integer != null){
       myMaxGutterIconWidth = integer.intValue();
     }
index 8a1991d5dd0f8e43bdc5fd74a221e0537c32135c..3bd460ba4ebe1dea6c9206e1d9d372189c3f07a0 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.wm.ex.WindowManagerEx;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.FilteringIterator;
 import gnu.trove.TIntStack;
+import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.awt.*;
@@ -169,6 +170,7 @@ public class IJSwingUtilities {
     };
   }
 
+  @Nullable
   public static <T extends Component> T findParentOfType(Component focusOwner, Class<T> aClass) {
     return (T)ContainerUtil.find(getParents(focusOwner), (FilteringIterator.InstanceOf<T>)FilteringIterator.instanceOf(aClass));
   }
index e9c5632cfd54b5db526d561599d7dae6b9d44120..6c4ec4283a70d61f4f6c513c1438eb92a116fec6 100644 (file)
@@ -314,7 +314,7 @@ public class PathsVerifier<BinaryType extends FilePatch> {
     }
 
     private boolean inContent(VirtualFile file) {
-      return ((ProjectLevelVcsManagerImpl) myVcsManager).isFileInContent(file);
+      return myVcsManager.isFileInContent(file);
     }
   }
 
index 49eb8b4f69744f6ddba300d0a29d237357b5c541..93f2db2e9a71303883d8fdf6298ddb1314e4b0db 100644 (file)
@@ -64,7 +64,7 @@ public class ChangeListWorker implements ChangeListsWriteOperations {
     myMap = new LinkedHashMap<String, LocalChangeList>();
     myIdx = new ChangeListsIndexes(worker.myIdx);
     myLocallyDeleted = worker.myLocallyDeleted.copy();
-    mySwitchedHolder = (SwitchedFileHolder) worker.mySwitchedHolder.copy();
+    mySwitchedHolder = worker.mySwitchedHolder.copy();
     myDelta = worker.myDelta;
     myListsToDisappear = new LinkedList<String>(worker.myListsToDisappear);
     
index 4d1378704f89381527ff8db4ab3ba2bf8ccd0077..8360723f824fa68932ab19e21f12a1861b94aa5d 100644 (file)
@@ -99,7 +99,7 @@ public class IgnoredFilesCompositeHolder implements IgnoredFilesHolder {
   public void notifyVcsStarted(AbstractVcs vcs) {
     myCurrentVcs = vcs;
     if (! myHolderMap.containsKey(vcs)) {
-      myHolderMap.put(vcs, vcs.reportsIgnoredDirectories() ? (IgnoredFilesHolder) new RecursiveFileHolder(myProject, HolderType.IGNORED) :
+      myHolderMap.put(vcs, vcs.reportsIgnoredDirectories() ? new RecursiveFileHolder(myProject, HolderType.IGNORED) :
         new MapIgnoredFilesHolder(myProject));
     }
   }
index 219446d0eb3a680d56818c5967a34b1af87a4ed6..b899e9c7bcae5f13d0508cea0e533bd03d5efed1 100644 (file)
@@ -57,7 +57,7 @@ public class BooleanFieldAlwaysNegatedInspection extends BaseGlobalInspection {
             return null;
         }
         return new ProblemDescriptor[]{manager.createProblemDescriptor(refField.getElement(), InspectionGadgetsBundle.message(
-                "boolean.field.always.negated.problem.descriptor"), false, (LocalQuickFix []) null,
+                "boolean.field.always.negated.problem.descriptor", refField.getName()), false, null,
                 ProblemHighlightType.GENERIC_ERROR_OR_WARNING)};
     }
 
index 57dc715bfba31a24b9e99b79584c7ec563b74da6..dbf71164379feeeac71acf2b9a30090a8e4760ed 100644 (file)
@@ -76,7 +76,7 @@ public class MethodReturnAlwaysConstantInspection extends BaseGlobalInspection {
             }
             out.add(manager.createProblemDescriptor(identifier,
                     InspectionGadgetsBundle.message(
-                            "method.return.always.constant.problem.descriptor"), false, (LocalQuickFix[]) null,
+                            "method.return.always.constant.problem.descriptor"), false, null,
                     ProblemHighlightType.GENERIC_ERROR_OR_WARNING));
             siblingRefMethod.putUserData(ALWAYS_CONSTANT,
                     Boolean.valueOf(true));
index 5f7e488e7679a59dc6d02b0eff6bb82ad8e6fb23..c0030b1d0c7d667af243033f44625ed296f08970 100644 (file)
@@ -442,7 +442,7 @@ public class AntConfigurationImpl extends AntConfigurationBase implements Persis
           for (final AntBuildFileBase buildFile : getBuildFiles()) {
             final Element element = new Element(BUILD_FILE);
             element.setAttribute(URL, buildFile.getVirtualFile().getUrl());
-            ((AntBuildFileBase)buildFile).writeProperties(element);
+            buildFile.writeProperties(element);
             saveEvents(element, buildFile);
             parentNode.addContent(element);
           }
index ea1eb3f8692fac4134be4879d152f0a325d073b0..695b033e977fc6b7be51dc0b220f57d3b95254ca 100644 (file)
@@ -136,7 +136,7 @@ public class CvsCommittedChangesProvider implements CachingCommittedChangesProvi
   public Pair<CvsChangeList, FilePath> getOneList(VirtualFile file, final VcsRevisionNumber number) throws VcsException {
     // todo implement in proper way
     final FilePathImpl filePath = new FilePathImpl(file);
-    CvsRepositoryLocation cvsLocation = (CvsRepositoryLocation) getLocationFor(filePath);
+    CvsRepositoryLocation cvsLocation = getLocationFor(filePath);
     if (cvsLocation == null) return null;
     final String module = cvsLocation.getModuleName();
     final CvsEnvironment connectionSettings = cvsLocation.getEnvironment();
index 74d904beb2a68bce71bb4b0a619002cf13348d47..25653f5b108163f712aa8dce2175a82ae5ddd9d5 100644 (file)
@@ -49,9 +49,9 @@ public class CustomizeKeywordSubstitutionStep extends WizardStep {
     public Comparator getComparator() {
       return new Comparator() {
         public int compare(Object o1, Object o2) {
-          KeywordSubstitutionWrapper firstSubstitution = (KeywordSubstitutionWrapper)((FileExtension)o1).getKeywordSubstitutionsWithSelection()
+          KeywordSubstitutionWrapper firstSubstitution = ((FileExtension)o1).getKeywordSubstitutionsWithSelection()
             .getSelection();
-          KeywordSubstitutionWrapper secondSubstitution = (KeywordSubstitutionWrapper)((FileExtension)o2).getKeywordSubstitutionsWithSelection()
+          KeywordSubstitutionWrapper secondSubstitution = ((FileExtension)o2).getKeywordSubstitutionsWithSelection()
             .getSelection();
           return
             firstSubstitution.toString().compareTo(secondSubstitution.toString());
index 8ef1bd69a830093cc9074461d668308d43cc8508..a64580fdfc6c342925af1f030e6cbffb9013ce8e 100644 (file)
@@ -136,11 +136,11 @@ public class GitDiffProvider implements DiffProvider {
       for (VcsFileRevision f : GitHistoryUtils.history(myProject, filePath)) {
         GitFileRevision gitRevision = (GitFileRevision)f;
         if (f.getRevisionNumber().equals(revisionNumber)) {
-          return GitContentRevision.createRevision(gitRevision.getPath(), (GitRevisionNumber)revisionNumber, myProject, selectedFile.getCharset());
+          return GitContentRevision.createRevision(gitRevision.getPath(), revisionNumber, myProject, selectedFile.getCharset());
         }
       }
       GitContentRevision candidate =
-        (GitContentRevision) GitContentRevision.createRevision(filePath, (GitRevisionNumber)revisionNumber, myProject,
+        (GitContentRevision) GitContentRevision.createRevision(filePath, revisionNumber, myProject,
                                                               selectedFile.getCharset());
       try {
         candidate.getContent();
index 671fdcd677d12e1f7b2cc9fafd555b8da7298a8b..f7d13a4eb553a0d76ad4996881da8f8078c9abab 100644 (file)
@@ -77,7 +77,7 @@ public class CaptionIcon implements Icon {
     g.setColor(myBgrnd.darker().darker());
     g.setFont(myPlusFont);
     if (myWithContinuation) {
-      ((Graphics2D)g).drawString(" +", x + myWidth - 2 - myAddWidth, y + myHeight - 3);
+      g.drawString(" +", x + myWidth - 2 - myAddWidth, y + myHeight - 3);
     }
 
     graphics2D.setPaint(oldPaint);
index 25ea10e01b1cf749b388077a57b4669d8f6d4850..6b22418eeca4ea044cfdadd2608013f31e49f26b 100644 (file)
@@ -85,7 +85,7 @@ public abstract class BasePopupAction extends DumbAwareAction implements CustomC
 
   protected void doAction(MouseEvent e) {
     final DefaultActionGroup group = createActionGroup();
-    final DataContext parent = DataManager.getInstance().getDataContext((Component) myPanel.getParent());
+    final DataContext parent = DataManager.getInstance().getDataContext(myPanel.getParent());
     final DataContext dataContext = SimpleDataContext.getSimpleContext(PlatformDataKeys.PROJECT.getName(), myProject, parent);
     final JBPopup popup = JBPopupFactory.getInstance()
       .createActionGroupPopup(null, group, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true,
index f48ddc92a6b943af542502e60c4a73cd70bd594d..c327b42e11319dd445fe45ca471d3e581ae4d2f3 100644 (file)
@@ -98,7 +98,7 @@ public class SuppressForMemberFix extends SuppressIntentionAction {
     GrDocCommentOwner container = getContainer(element);
     assert container != null;
     if (!CodeInsightUtilBase.preparePsiElementForWrite(container)) return;
-    final GrModifierList modifierList = (GrModifierList)((PsiModifierListOwner)container).getModifierList();
+    final GrModifierList modifierList = (GrModifierList)container.getModifierList();
     if (modifierList != null) {
       addSuppressAnnotation(project, modifierList, myID);
     }
index 8cf1d13a619c360753dd8b17c313b61571fe9e8e..2356aa7fc8c33d0e50b6c5a77cc12fe498de8d04 100644 (file)
@@ -113,7 +113,7 @@ public class GroovyDslDefaultMembers implements GdslMembersProvider {
     }
 
     if (call instanceof GrMethodCallExpression) {
-      for (GrExpression arg : ((GrMethodCallExpression)call).getClosureArguments()) {
+      for (GrExpression arg : call.getClosureArguments()) {
         if (arg instanceof GrClosableBlock && PsiTreeUtil.findCommonParent(place, arg) == arg) {
           return call;
         }
index 9cf24fd4a4dc6e4e2b272c286c9e7535f3805c46..647d80f67fc4ae71dc0cbcbe7231300d37c0129c 100644 (file)
@@ -36,7 +36,7 @@ class MergeIfAndPredicate implements PsiElementPredicate {
     if (thenBranch == null) {
       return false;
     }
-    thenBranch = ConditionalUtils.stripBraces((GrStatement) thenBranch);
+    thenBranch = ConditionalUtils.stripBraces(thenBranch);
     if (!(thenBranch instanceof GrIfStatement)) {
       return false;
     }
index d06218c9defb94a938e7252a7c473d4c77032adc..b51c2700df0b46ed6933f9331ac4e6e2bdd6bdd7 100644 (file)
@@ -1253,7 +1253,7 @@ public class PsiUtil {
   }
 
   public static boolean isExpressionUsed(PsiElement expr) {
-    while (expr.getParent() instanceof GrParenthesizedExpression) expr = (GrExpression)expr.getParent();
+    while (expr.getParent() instanceof GrParenthesizedExpression) expr = expr.getParent();
 
     final PsiElement parent = expr.getParent();
     if (parent instanceof GrBinaryExpression ||
index 909e0cffd411cba238758614ef2e106704e856ab..be68941ad869e384dc56eb6313f261c8df9e1a9d 100644 (file)
@@ -367,8 +367,8 @@ public class GrChangeSignatureUsageProcessor implements ChangeSignatureUsageProc
   private static void processClassUsage(GrTypeDefinition psiClass, JavaChangeInfo changeInfo) {
     String name = psiClass.getName();
 
-    GrConstructor constructor = ((GrConstructor)GroovyPsiElementFactory.getInstance(psiClass.getProject())
-      .createConstructorFromText(name, ArrayUtil.EMPTY_STRING_ARRAY, ArrayUtil.EMPTY_STRING_ARRAY, "{}", null));
+    GrConstructor constructor = GroovyPsiElementFactory.getInstance(psiClass.getProject())
+      .createConstructorFromText(name, ArrayUtil.EMPTY_STRING_ARRAY, ArrayUtil.EMPTY_STRING_ARRAY, "{}", null);
 
     GrModifierList list = constructor.getModifierList();
     if (psiClass.hasModifierProperty(GrModifier.PRIVATE)) list.setModifierProperty(GrModifier.PRIVATE, true);
index e437d429fd1945fa1f08eb3f924a541b5bdf0751..735936f24043bd086550f158660b6b1b343268f5 100644 (file)
@@ -222,7 +222,7 @@ public class GrIntroduceFieldHandler extends GrIntroduceHandlerBase<GrIntroduceF
     }
     GrAssignmentExpression init = ((GrAssignmentExpression)GroovyPsiElementFactory.getInstance(context.project)
       .createExpressionFromText(settings.getName() + " = " + initializer.getText()));
-    init = (GrAssignmentExpression)block.addStatementBefore(init, (GrStatement)anchor);
+    init = (GrAssignmentExpression)block.addStatementBefore(init, anchor);
     replaceOccurence(field, init.getLValue());
   }
 
index 5a6f72f9a79802756c29e4eac812a1ff837c5faa..244056a93d85aaa1b4713b3694f4d1d6f1805e9f 100644 (file)
@@ -247,7 +247,7 @@ public abstract class GroovyIntroduceVariableBase extends GrIntroduceHandlerBase
     if (!(realContainer instanceof GrLoopStatement)) {
       if (realContainer instanceof GrStatementOwner) {
         GrStatementOwner block = (GrStatementOwner)realContainer;
-        varDecl = (GrVariableDeclaration)block.addStatementBefore(varDecl, (GrStatement)anchorElement);
+        varDecl = (GrVariableDeclaration)block.addStatementBefore(varDecl, anchorElement);
       }
     }
     else {
index b0c3058b106b1ebe33fca3be95de92e7d5a4a4b6..dc1acccfe367f4c0cb4fab7d29bb2fe274cacf20 100644 (file)
@@ -93,7 +93,7 @@ public class UnusedMessageFormatParameterInspection extends BaseLocalInspectionT
               ASTNode[] nodes = property.getNode().getChildren(null);
               PsiElement valElement = nodes.length < 3 ? property : nodes[2].getPsi();
               problemDescriptors.add(manager.createProblemDescriptor(valElement, PropertiesBundle.message(
-                "unused.message.format.parameter.problem.descriptor", integer.toString(), Integer.toString(i)), isOnTheFly, (LocalQuickFix[])null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING));
+                "unused.message.format.parameter.problem.descriptor", integer.toString(), Integer.toString(i)), isOnTheFly, null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING));
               break;
             }
           }
index 551c35ae331698f33c56c1b1705f1a7c781ea5f4..98f29c18c6dd72fa777f6343dac0ded822b8e76e 100644 (file)
@@ -44,7 +44,7 @@ public class MavenUIModifiableModelsProvider extends MavenBaseModifiableModelsPr
     myModifiableArtifactModel = modifiableArtifactModel;
 
     ProjectLibrariesConfigurable configurable = ProjectLibrariesConfigurable.getInstance(project);
-    myLibrariesModel = (LibrariesModifiableModel)configurable.getModelProvider().getModifiableModel();
+    myLibrariesModel = configurable.getModelProvider().getModifiableModel();
   }
 
   @Override
index 0f125fa0dd01ea0a425076e3258795dc93d47cf3..018d71e6ca3f879629645ecb4367bde7c3694cb3 100644 (file)
@@ -426,13 +426,13 @@ public class MavenProjectsManagerWatcher {
     public void before(List<? extends VFileEvent> events) {
       for (VFileEvent each : events) {
         if (each instanceof VFileDeleteEvent) {
-          deleteRecursively(((VFileDeleteEvent)each).getFile());
+          deleteRecursively(each.getFile());
         }
         else {
           if (!isRelevant(each.getPath())) continue;
           if (each instanceof VFilePropertyChangeEvent) {
             if (((VFilePropertyChangeEvent)each).getPropertyName().equals(VirtualFile.PROP_NAME)) {
-              deleteRecursively(((VFilePropertyChangeEvent)each).getFile());
+              deleteRecursively(each.getFile());
             }
           }
           else if (each instanceof VFileMoveEvent) {
@@ -478,15 +478,15 @@ public class MavenProjectsManagerWatcher {
           }
         }
         else if (each instanceof VFileContentChangeEvent) {
-          updateFile(((VFileContentChangeEvent)each).getFile());
+          updateFile(each.getFile());
         }
         else if (each instanceof VFilePropertyChangeEvent) {
           if (((VFilePropertyChangeEvent)each).getPropertyName().equals(VirtualFile.PROP_NAME)) {
-            updateFile(((VFilePropertyChangeEvent)each).getFile());
+            updateFile(each.getFile());
           }
         }
         else if (each instanceof VFileMoveEvent) {
-          updateFile(((VFileMoveEvent)each).getFile());
+          updateFile(each.getFile());
         }
       }
       apply();
index 2be48ed8814c1433d93b31d3064e7c21eef0047b..5ac4acf991a76b74115f03b0cda64a0d735f7b25 100644 (file)
@@ -40,15 +40,15 @@ public class PropertiesStructureViewElement implements StructureViewTreeElement
   }
 
   public void navigate(boolean requestFocus) {
-    ((NavigationItem)myProperty).navigate(requestFocus);
+    myProperty.navigate(requestFocus);
   }
 
   public boolean canNavigate() {
-    return ((NavigationItem)myProperty).canNavigate();
+    return myProperty.canNavigate();
   }
 
   public boolean canNavigateToSource() {
-    return ((NavigationItem)myProperty).canNavigateToSource();
+    return myProperty.canNavigateToSource();
   }
 
   public StructureViewTreeElement[] getChildren() {
index a363423aba5a8cbf96b26732c39833ee9e7ddeb0..ca8390dbfa23e90367104a9363d084a976de7613 100644 (file)
@@ -141,7 +141,7 @@ public class MarkLocallyDeletedTreeConflictResolvedAction extends AnAction {
       final LocallyDeletedChange change = missingFiles.get(0);
       myEnabled = change instanceof SvnLocallyDeletedChange && ((SvnLocallyDeletedChange) change).getConflictState().isTree();
       if (myEnabled) {
-        myPath = ((SvnLocallyDeletedChange) change).getPath();
+        myPath = change.getPath();
       }
       else {
         myPath = null;
index e85bdadb51163b9887efd7d3e08df1926472ab48..5a3ff493702fdccd7c8896430acaa2dc53fb4560 100644 (file)
@@ -168,7 +168,7 @@ public class SvnCheckinEnvironment implements CheckinEnvironment {
     if (committables.isEmpty()) {
       return;
     }
-    File[] pathsToCommit = (File[])committables.toArray(new File[committables.size()]);
+    File[] pathsToCommit = committables.toArray(new File[committables.size()]);
     boolean keepLocks = SvnConfiguration.getInstance(mySvnVcs.getProject()).isKeepLocks();
     SVNCommitPacket[] commitPackets = null;
     SVNCommitInfo[] results;
index db14522bbf73c57079105aa2df65bbd5c1e292c5..2ec143b1f22860d2d4d29b1e59c2283ee83f268d 100644 (file)
@@ -104,7 +104,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
 
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       if (! groupConfigurable.getEditableObject().isDefault()) {
         result.removeAll(groupConfigurable.getRepositories());
       }
@@ -120,7 +120,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
     
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       final String groupName = groupConfigurable.getEditableObject().getName();
 
       if (checkSet.contains(groupName)) {
@@ -132,7 +132,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
 
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       groupConfigurable.applyImpl();
       if(! groupConfigurable.validate(errorMessageRef)) {
         listener.onError(errorMessageRef.get(), myComponent, false);
@@ -223,7 +223,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
 
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       groupConfigurable.apply();
       groups.add(groupConfigurable.getEditableObject());
     }
@@ -236,7 +236,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
     
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       groupConfigurable.reset();
     }
   }
@@ -310,7 +310,7 @@ public class SvnConfigureProxiesComponent extends MasterDetailsComponent {
   public void setIsValid(final boolean valid) {
     for (int i = 0; i < myRoot.getChildCount(); i++) {
       final MyNode node = (MyNode) myRoot.getChildAt(i);
-      final GroupConfigurable groupConfigurable = (GroupConfigurable) ((MyNode) node).getConfigurable();
+      final GroupConfigurable groupConfigurable = (GroupConfigurable) node.getConfigurable();
       groupConfigurable.setIsValid(valid);
     }
   }
index 993f830075119f9a8640063bc21d4203f3176352..188c1a6754f4ce7f69cd756a42fba5246643bf8b 100644 (file)
@@ -653,7 +653,7 @@ public class SvnCommittedChangesProvider implements CachingCommittedChangesProvi
                          // do not add lists without info - this situation is possible for lists where there are paths that user has no rights to observe
                          return;
                        }
-                       result[0] = new SvnChangeList(myVcs, (SvnRepositoryLocation) location, logEntry, repositoryUrl.toString());
+                       result[0] = new SvnChangeList(myVcs, location, logEntry, repositoryUrl.toString());
                      }
                    });
     }
index ec76da3139a8720be41545c745de60e72c553c4e..734a4690519ca61842bbc8b734dd06260ceeff65 100644 (file)
@@ -466,7 +466,7 @@ public class SvnHistoryProvider implements VcsHistoryProvider, VcsCacheableHisto
     }
 
     public VcsFileRevision valueOf(final VcsFileRevision vcsFileRevision) {
-      return (VcsFileRevision) vcsFileRevision;
+      return vcsFileRevision;
     }
 
     public String getText(final VcsFileRevision vcsFileRevision) {
index f353522e0f940ca76a4052ce99acce5d079b754a..a2026af6fe0ddda7cf4d9d83a6e20daac187e0b9 100644 (file)
@@ -437,7 +437,7 @@ public final class Painter {
       g2d.setColor(Color.BLUE);
       g2d.fillRect(0, 0, (int) stringBounds.getWidth(), (int) stringBounds.getHeight());
       g2d.setColor(Color.WHITE);
-      g.drawString(tagBuilder.toString(), 0, (int) g.getFontMetrics().getAscent());
+      g.drawString(tagBuilder.toString(), 0, g.getFontMetrics().getAscent());
     }
   }
 }
index 9bbc5a174be206b8f2f1d76a0919e2d40fe054b1..7ba3553ec5707a2cb1b314fcd13156c42c8e09be 100644 (file)
@@ -76,7 +76,7 @@ public abstract class BasicDomElementComponent<T extends DomElement> extends Abs
     for (final AbstractDomChildrenDescription description : domElement.getGenericInfo().getChildrenDescriptions()) {
       final JComponent boundComponent = getBoundComponent(description);
       if (boundComponent != null) {
-        if (description instanceof DomFixedChildDescription && DomUtil.isGenericValueType(((DomFixedChildDescription)description).getType())) {
+        if (description instanceof DomFixedChildDescription && DomUtil.isGenericValueType(description.getType())) {
           if ((description.getValues(domElement)).size() == 1) {
             final GenericDomValue element = domElement.getManager().createStableValue(new Factory<GenericDomValue>() {
               public GenericDomValue create() {
index c78cbfc6dc3d305f23d65fa768cd0d21f4427591..f0448ab69b574d2c84753c2e0ae980f5088d0cd2 100644 (file)
@@ -129,7 +129,7 @@ public class DtdCompletionData extends CompletionData {
     public void handleInsert(InsertionContext context, LookupElement item) {
       super.handleInsert(context, item);
 
-      if (((MutableLookupElement)item).getObject().toString().startsWith("<!")) {
+      if (item.getObject().toString().startsWith("<!")) {
         PsiDocumentManager.getInstance(context.getProject()).commitAllDocuments();
 
         int caretOffset = context.getEditor().getCaretModel().getOffset();
index 2111ab3a5756f3eebfb4be1473e411d1860f0799..fa9246db0f3c8b24b517c13b84c900be66228283 100644 (file)
@@ -90,7 +90,7 @@ public class InsertRequiredAttributeFix implements IntentionAction, LocalQuickFi
       return;
     }
     final XmlAttributeDescriptor attrDescriptor = descriptor.getAttributeDescriptor(myAttrName, myTag);
-    boolean indirectSyntax = XmlExtension.getExtension((XmlFile)myTag.getContainingFile()).isIndirectSyntax(attrDescriptor);
+    boolean indirectSyntax = XmlExtension.getExtension(myTag.getContainingFile()).isIndirectSyntax(attrDescriptor);
 
     PsiElement anchor = SourceTreeToPsiMap.treeElementToPsi(
       XmlChildRole.EMPTY_TAG_END_FINDER.findChild(treeElement)
index c5d8737e3202b73338959d207f05707d8ff61bcd..cfb2b807572eab42f471cd5a4bec4217eb369502 100644 (file)
@@ -66,7 +66,7 @@ public class XmlStructureViewBuilderFactory implements PsiStructureViewFactory {
   }
 
   private static StructureViewBuilder getStructureViewBuilderForExtensions(final PsiFile psiFile) {
-    for (Language language : ((XMLLanguage)XMLLanguage.INSTANCE).getLanguageExtensionsForFile(psiFile)) {
+    for (Language language : XMLLanguage.INSTANCE.getLanguageExtensionsForFile(psiFile)) {
       final StructureViewBuilder builder = LanguageStructureViewBuilder.INSTANCE.forLanguage(language).getStructureViewBuilder(psiFile);
       if (builder != null) {
         return builder;
index 95d3f40d1d14ebded66d5f3336ac9375abbb97db..ba4c8b976f946bebff28bb74e94de5170ab95a86 100644 (file)
@@ -56,7 +56,7 @@ public class SchemaPrefixReference extends PsiReferenceBase<XmlElement> implemen
       myPrefix = new SchemaPrefix((XmlAttribute)myElement, getRangeInElement(), myName);
     }
     else if (myElement instanceof XmlAttributeValue &&
-             ((XmlAttribute)((XmlAttributeValue)myElement).getParent()).getLocalName().equals("prefix")) {
+             ((XmlAttribute)myElement.getParent()).getLocalName().equals("prefix")) {
       myPrefix = SchemaPrefix.createJspPrefix((XmlAttributeValue)myElement, myName);
     }
     else {