diff --git a/java/debugger/impl/src/com/intellij/debugger/jdi/ObjectReferenceProxyImpl.java b/java/debugger/impl/src/com/intellij/debugger/jdi/ObjectReferenceProxyImpl.java index 7c799dc79890..40d644f27f7c 100644 --- a/java/debugger/impl/src/com/intellij/debugger/jdi/ObjectReferenceProxyImpl.java +++ b/java/debugger/impl/src/com/intellij/debugger/jdi/ObjectReferenceProxyImpl.java @@ -109,8 +109,7 @@ public class ObjectReferenceProxyImpl extends JdiProxy { } if(this == o) return true; - ObjectReference ref = myObjectReference; - return ref.equals(((ObjectReferenceProxyImpl)o).myObjectReference); + return myObjectReference.equals(((ObjectReferenceProxyImpl)o).myObjectReference); } diff --git a/java/java-impl/src/com/intellij/codeInsight/ExpectedTypeInfoImpl.java b/java/java-impl/src/com/intellij/codeInsight/ExpectedTypeInfoImpl.java index 4a57cfd42563..71bac7687374 100644 --- a/java/java-impl/src/com/intellij/codeInsight/ExpectedTypeInfoImpl.java +++ b/java/java-impl/src/com/intellij/codeInsight/ExpectedTypeInfoImpl.java @@ -159,8 +159,7 @@ public class ExpectedTypeInfoImpl implements ExpectedTypeInfo { if (info1.type.isAssignableFrom(type)) return new ExpectedTypeInfoImpl[] {info1}; } else if (info1.kind == TYPE_OR_SUBTYPE) { - PsiType otherType = info1.type; - if (otherType.isAssignableFrom(type)) return new ExpectedTypeInfoImpl[] {this}; + if (info1.type.isAssignableFrom(type)) return new ExpectedTypeInfoImpl[] {this}; } else if (info1.kind == TYPE_OR_SUPERTYPE) { PsiType otherType = info1.type; diff --git a/java/java-impl/src/com/intellij/packageDependencies/ui/PackageNode.java b/java/java-impl/src/com/intellij/packageDependencies/ui/PackageNode.java index 0ec0a348a6a6..78288bc2befe 100644 --- a/java/java-impl/src/com/intellij/packageDependencies/ui/PackageNode.java +++ b/java/java-impl/src/com/intellij/packageDependencies/ui/PackageNode.java @@ -118,9 +118,8 @@ public class PackageNode extends PackageDependenciesNode { @Override public boolean canSelectInLeftTree(final Map> deps) { Set files = deps.keySet(); - String packageName = myPackageQName; for (PsiFile file : files) { - if (file instanceof PsiJavaFile && Comparing.equal(packageName, ((PsiJavaFile)file).getPackageName())) { + if (file instanceof PsiJavaFile && Comparing.equal(myPackageQName, ((PsiJavaFile)file).getPackageName())) { return true; } } diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiOldInferenceHelper.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiOldInferenceHelper.java index f547891770fd..8c6bc8ac67be 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiOldInferenceHelper.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/PsiOldInferenceHelper.java @@ -442,7 +442,6 @@ public class PsiOldInferenceHelper implements PsiInferenceHelper { } if (!(param instanceof PsiClassType)) return null; - PsiManager manager = myManager; if (arg instanceof PsiPrimitiveType) { if (!JavaVersionService.getInstance().isAtLeast(typeParam, JavaSdkVersion.JDK_1_7) && !isContraVariantPosition) return null; arg = ((PsiPrimitiveType)arg).getBoxedType(typeParam); @@ -477,7 +476,7 @@ public class PsiOldInferenceHelper implements PsiInferenceHelper { PsiClass argClass = (PsiClass)argResult.getElement(); if (argClass == null) return null; - PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory(); + PsiElementFactory factory = JavaPsiFacade.getInstance(myManager.getProject()).getElementFactory(); PsiType patternType = factory.createType(typeParam); if (isContraVariantPosition) { PsiSubstitutor substitutor = TypeConversionUtil.getClassSubstitutor(paramClass, argClass, argResult.getSubstitutor()); diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeUtil.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeUtil.java index f935361122e3..2a1e318a830a 100644 --- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeUtil.java +++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeUtil.java @@ -104,8 +104,7 @@ public class FavoritesTreeUtil { @Nullable public static FavoritesListNode extractParentList(FavoritesTreeNodeDescriptor descriptor) { - final AbstractTreeNode node = descriptor.getElement(); - AbstractTreeNode current = node; + AbstractTreeNode current = descriptor.getElement(); while (current != null) { if (current instanceof FavoritesListNode) { return (FavoritesListNode)current; diff --git a/platform/lang-impl/src/com/intellij/internal/psiView/formattingblocks/BlockViewerPsiBasedTree.java b/platform/lang-impl/src/com/intellij/internal/psiView/formattingblocks/BlockViewerPsiBasedTree.java index 781827c8f623..d2b0a81f7090 100644 --- a/platform/lang-impl/src/com/intellij/internal/psiView/formattingblocks/BlockViewerPsiBasedTree.java +++ b/platform/lang-impl/src/com/intellij/internal/psiView/formattingblocks/BlockViewerPsiBasedTree.java @@ -212,9 +212,8 @@ public class BlockViewerPsiBasedTree implements ViewerPsiBasedTree { if (!(item instanceof BlockTreeNode)) return; BlockTreeNode descriptor = (BlockTreeNode)item; - PsiElement rootPsi = myRootElement; int blockStart = descriptor.getBlock().getTextRange().getStartOffset(); - PsiFile file = rootPsi.getContainingFile(); + PsiFile file = myRootElement.getContainingFile(); PsiElement currentPsiEl = InjectedLanguageUtil.findElementAtNoCommit(file, blockStart); if (currentPsiEl == null) currentPsiEl = file; int blockLength = descriptor.getBlock().getTextRange().getLength(); diff --git a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java index 2d3369de9b68..50fdabdfcd40 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java @@ -78,11 +78,7 @@ public class FileTypeConfigurable implements SearchableConfigurable, Configurabl private void updateFileTypeList() { FileType[] types = myTempFileTypes.toArray(FileType.EMPTY_ARRAY); - Arrays.sort(types, (o1, o2) -> { - FileType fileType1 = (FileType)o1; - FileType fileType2 = (FileType)o2; - return fileType1.getDescription().compareToIgnoreCase(fileType2.getDescription()); - }); + Arrays.sort(types, (o1, o2) -> o1.getDescription().compareToIgnoreCase(o2.getDescription())); myRecognizedFileType.setFileTypes(types); } diff --git a/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java b/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java index add62968ae9a..d6d84851bc42 100644 --- a/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java @@ -138,8 +138,7 @@ public class FormattingDocumentModelImpl implements FormattingDocumentModel { @Override public boolean containsWhiteSpaceSymbolsOnly(int startOffset, int endOffset) { - WhiteSpaceFormattingStrategy strategy = myWhiteSpaceStrategy; - if (strategy.check(myDocument.getCharsSequence(), startOffset, endOffset) >= endOffset) { + if (myWhiteSpaceStrategy.check(myDocument.getCharsSequence(), startOffset, endOffset) >= endOffset) { return true; } PsiElement injectedElement = InjectedLanguageUtil.findElementAtNoCommit(myFile, startOffset); diff --git a/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java b/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java index 9a7c131316f6..3c731f616b22 100644 --- a/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java +++ b/platform/platform-impl/src/com/intellij/ide/dnd/Highlighters.java @@ -31,9 +31,8 @@ public class Highlighters implements DnDEvent.DropTargetHighlightingType { static void show(int aType, JLayeredPane aPane, Rectangle aRectangle, DnDEvent aEvent) { List toShow = new ArrayList<>(); for (DropTargetHighlighter ourHightlighter : ourHightlighters) { - DropTargetHighlighter each = (DropTargetHighlighter)ourHightlighter; - if ((each.getMask() & aType) != 0) { - toShow.add(each); + if ((ourHightlighter.getMask() & aType) != 0) { + toShow.add(ourHightlighter); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java index 981786fc23c0..fb6cadf726da 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/status/ProcessPopup.java @@ -163,7 +163,7 @@ public class ProcessPopup { myActiveFocusedContent.add(wrapper, BorderLayout.CENTER); - final JScrollPane scrolls = new JBScrollPane(myActiveFocusedContent) { + myActiveContentComponent = new JBScrollPane(myActiveFocusedContent) { @Override public Dimension getPreferredSize() { if (myProcessBox.getComponentCount() > 0) { @@ -173,7 +173,6 @@ public class ProcessPopup { } } }; - myActiveContentComponent = scrolls; updateContentUI(); } diff --git a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java index 72b2685b2838..c08868e5ee9a 100644 --- a/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java +++ b/platform/testGuiFramework/src/com/intellij/testGuiFramework/fixtures/IdeFrameFixture.java @@ -857,7 +857,6 @@ public class IdeFrameFixture extends ComponentFixture 0) { builder.append(System.getProperty("line.separator")); } diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java index 7dd5c0f8871f..84d3f47e30a8 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/history/VcsAnnotationCachedProxy.java @@ -84,11 +84,10 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider { */ private FileAnnotation annotate(VirtualFile file, final VcsRevisionNumber revisionNumber, final boolean currentRevision, final ThrowableComputable delegate) throws VcsException { - final AnnotationProvider annotationProvider = myAnnotationProvider; final FilePath filePath = VcsUtil.getFilePath(file); - final VcsCacheableAnnotationProvider cacheableAnnotationProvider = (VcsCacheableAnnotationProvider)annotationProvider; + final VcsCacheableAnnotationProvider cacheableAnnotationProvider = (VcsCacheableAnnotationProvider)myAnnotationProvider; VcsAnnotation vcsAnnotation = null; if (revisionNumber != null) { diff --git a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java index 0f671a3a8a2d..b2e844bca98d 100644 --- a/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java +++ b/plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/javacvsImpl/io/LineReader.java @@ -87,10 +87,9 @@ public class LineReader { return getLineArray(); } } - final byte[] buffer = myBuffer; while (myBytesBuffered != -1) { for (; myPosition < myBytesBuffered; myPosition++) { - final byte c = buffer[myPosition]; + final byte c = myBuffer[myPosition]; switch (c) { case '\r': if (myLastEol == '\r') { diff --git a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/log/LogMessageParser.java b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/log/LogMessageParser.java index c84f1f071382..a9d4bf77fdb3 100644 --- a/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/log/LogMessageParser.java +++ b/plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/log/LogMessageParser.java @@ -216,8 +216,7 @@ final public class LogMessageParser extends AbstractMessageParser { return; } if (line.startsWith(TOTAL_REVISIONS)) { - final String separator = SELECTED_REVISIONS; - final int semicolonIndex = line.indexOf(separator); + final int semicolonIndex = line.indexOf(SELECTED_REVISIONS); if (semicolonIndex < 0) { // no selected revisions here.. logInfo.setTotalRevisions(line.substring(TOTAL_REVISIONS.length()).trim()); diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/resolve/DependencyResolverImpl.java b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/resolve/DependencyResolverImpl.java index 8159a1a2d912..daf56e32b0e5 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/resolve/DependencyResolverImpl.java +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/util/resolve/DependencyResolverImpl.java @@ -601,9 +601,8 @@ public class DependencyResolverImpl implements DependencyResolver { File artifactDir = parents.get(parents.size() - 2); File versionDir = parents.get(parents.size() - 3); - File parentFile = versionDir; - if (parentFile != null) { - File[] hashDirs = parentFile.listFiles(); + if (versionDir != null) { + File[] hashDirs = versionDir.listFiles(); if (hashDirs != null) { for (File hashDir : hashDirs) { File[] sourcesJars = hashDir.listFiles(new FilenameFilter() { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewPane.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewPane.java index 298b0c03eb91..d356cf613e3f 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewPane.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/projectView/MvcProjectViewPane.java @@ -210,9 +210,8 @@ public class MvcProjectViewPane extends AbstractProjectViewPSIPane implements Id @NotNull @Override protected ProjectAbstractTreeStructureBase createStructure() { - final Project project = myProject; final String id = getId(); - return new ProjectTreeStructure(project, id) { + return new ProjectTreeStructure(myProject, id) { @Override public boolean isHideEmptyMiddlePackages() { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java index afad0bb14b85..c174fc5e3433 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserDialog.java @@ -1056,8 +1056,7 @@ public class RepositoryBrowserDialog extends DialogWrapper { return; } - Project p = myProject; - CheckoutOptionsDialog dialog = new CheckoutOptionsDialog(p, url, dir, SvnUtil.getVirtualFile(dir.getAbsolutePath()), relativePath); + CheckoutOptionsDialog dialog = new CheckoutOptionsDialog(myProject, url, dir, SvnUtil.getVirtualFile(dir.getAbsolutePath()), relativePath); dialog.show(); dir = dialog.getTarget(); if (dialog.isOK() && dir != null) { diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java index bf27a8530aa5..5c8b051173fb 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java @@ -357,8 +357,7 @@ public class SvnInfoHandler extends DefaultHandler { protected void updateInfo(Attributes attributes, SvnInfoStructure structure) throws SAXException { final String revision = attributes.getValue("revision"); try { - final long number = Long.parseLong(revision); - structure.myCommittedRevision = number; + structure.myCommittedRevision = Long.parseLong(revision); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -510,8 +509,7 @@ public class SvnInfoHandler extends DefaultHandler { @Override public void characters(String s, SvnInfoStructure structure) throws SAXException { try { - final long number = Long.parseLong(s); - structure.myCopyFromRevision = number; + structure.myCopyFromRevision = Long.parseLong(s); } catch (NumberFormatException e) { throw new SAXException(e); } @@ -706,8 +704,7 @@ public class SvnInfoHandler extends DefaultHandler { final String revision = attributes.getValue("revision"); assertSAX(! StringUtil.isEmptyOrSpaces(revision)); try { - final long number = Long.parseLong(revision); - structure.myRevision = number; + structure.myRevision = Long.parseLong(revision); } catch (NumberFormatException e) { structure.myRevision = -1; //throw new SAXException(e); diff --git a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java index 2e1fbccf1450..96dedc58161d 100644 --- a/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java +++ b/xml/impl/src/com/intellij/psi/formatter/xml/AbstractSyntheticBlock.java @@ -118,8 +118,7 @@ public abstract class AbstractSyntheticBlock implements Block { } public boolean isTagDescription() { - final ASTNode startTreeNode = myStartTreeNode; - return isTagDescription(startTreeNode); + return isTagDescription(myStartTreeNode); } private static boolean isTagDescription(final ASTNode startTreeNode) {