From feb2ee9625a5f940f2ee5f89fe4a58b56ab71e35 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Thu, 10 Oct 2024 13:26:12 +0200 Subject: [PATCH] Warnings fixed (mostly redundant cast) GitOrigin-RevId: 63bdb7f359a1a2cd37cb6a691b3d94db8ba3ce02 --- .../dataFlow/inference/JavaSourceInference.java | 10 +++++----- .../lang/java/parser/BasicJavaParserUtil.java | 2 +- .../psi/impl/source/tree/java/PsiCodeBlockImpl.java | 2 +- .../jps/incremental/storage/BuildDataManager.java | 8 ++++---- .../src/com/intellij/lang/pratt/MutableMarker.java | 5 ++--- .../fileTypes/impl/FileTypeDetectionService.java | 5 ++--- .../roots/ui/util/JarSubfileCellAppearance.java | 3 +-- .../ContentHashEnumeratorOverDurableEnumerator.java | 11 +++++------ .../concurrency/ConcurrentIntKeyRefValueHashMap.java | 2 +- .../util/jdom/src/org/jdom/filter/ElementFilter.java | 9 +++------ .../containers/ConcurrentIntKeyRefValueHashMap.java | 2 +- .../idea/maven/tasks/MavenKeymapExtension.java | 8 ++++---- .../idea/maven/tasks/MavenShortcutsManager.java | 6 +++--- .../YAMLKeysSearchEverywhereContributor.java | 3 +-- .../python/debugger/PyUnitTestsDebuggingService.java | 9 +++++---- .../launcher-generator/src/com/pme/exe/ExeReader.java | 2 +- .../tests/com/intellij/util/xml/ProxyTest.java | 1 + 17 files changed, 41 insertions(+), 47 deletions(-) diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/inference/JavaSourceInference.java b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/inference/JavaSourceInference.java index c070750872fd..a243199de101 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/inference/JavaSourceInference.java +++ b/java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/inference/JavaSourceInference.java @@ -269,22 +269,22 @@ public final class JavaSourceInference { return contract; }); } - + public static boolean canInferFromSource(@NotNull PsiMethodImpl method) { return getInferenceMode(method) == InferenceMode.ENABLED; } private static InferenceMode getInferenceMode(@NotNull PsiMethodImpl method) { if (isLibraryCode(method) || - ((PsiMethod)method).hasModifierProperty(PsiModifier.ABSTRACT) || - ((PsiMethod)method).hasModifierProperty(PsiModifier.NATIVE)) { + method.hasModifierProperty(PsiModifier.ABSTRACT) || + method.hasModifierProperty(PsiModifier.NATIVE)) { return InferenceMode.DISABLED; } - if (((PsiMethod)method).hasModifierProperty(PsiModifier.STATIC)) return InferenceMode.ENABLED; + if (method.hasModifierProperty(PsiModifier.STATIC)) return InferenceMode.ENABLED; if (PsiUtil.canBeOverridden(method)) { PsiClass containingClass = method.getContainingClass(); - if (containingClass != null && (PsiUtil.isLocalClass(containingClass) || + if (containingClass != null && (PsiUtil.isLocalClass(containingClass) || !containingClass.isInterface() && containingClass.hasModifierProperty(PsiModifier.PRIVATE))) { if (ClassInheritorsSearch.search(containingClass, new LocalSearchScope(containingClass.getContainingFile()), false) .findFirst() == null) { diff --git a/java/java-frontback-psi-impl/src/com/intellij/lang/java/parser/BasicJavaParserUtil.java b/java/java-frontback-psi-impl/src/com/intellij/lang/java/parser/BasicJavaParserUtil.java index 7afb60d3f110..e2f5a8cbde85 100644 --- a/java/java-frontback-psi-impl/src/com/intellij/lang/java/parser/BasicJavaParserUtil.java +++ b/java/java-frontback-psi-impl/src/com/intellij/lang/java/parser/BasicJavaParserUtil.java @@ -74,7 +74,7 @@ public final class BasicJavaParserUtil { @Nullable public static IElementType exprType(@Nullable final PsiBuilder.Marker marker) { - return marker != null ? ((LighterASTNode)marker).getTokenType() : null; + return marker != null ? marker.getTokenType() : null; } // used instead of PsiBuilder.error() as it keeps all subsequent error messages diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java index b55a46c9394f..8878e5a019d6 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java @@ -263,7 +263,7 @@ public final class PsiCodeBlockImpl extends LazyParseablePsiElement implements P } if (child == null) { - child = ((PsiElement)this).getLastChild(); + child = this.getLastChild(); } while (child != null) { diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/BuildDataManager.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/BuildDataManager.java index 2ee949677ded..1fc4d32188aa 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/BuildDataManager.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/storage/BuildDataManager.java @@ -265,7 +265,7 @@ public final class BuildDataManager { finally { SourceToOutputMappingWrapper sourceToOutput = buildTargetToSourceToOutputMapping.remove(target); if (sourceToOutput != null && sourceToOutput.myDelegate != null) { - ((StorageOwner)sourceToOutput.myDelegate).close(); + sourceToOutput.myDelegate.close(); } if (newDataManager != null) { @@ -385,7 +385,7 @@ public final class BuildDataManager { if (outputToTargetMapping != null) { outputToTargetMapping.flush(memoryCachesOnly); } - + if (sourceToFormMap != null) { sourceToFormMap.flush(memoryCachesOnly); } @@ -464,7 +464,7 @@ public final class BuildDataManager { static void execAll(Class errorClass, IOOperation... operations) throws T { execAll(errorClass, Arrays.asList(operations)); } - + static void execAll(Class errorClass, Iterable> operations) throws T { Throwable error = null; for (IOOperation operation : operations) { @@ -616,7 +616,7 @@ public final class BuildDataManager { private @NotNull StorageOwner allTargetStorages() { return allTargetStorages(f -> {}); } - + private static final class SourceToOutputMappingWrapper implements SourceToOutputMapping { private final SourceToOutputMappingImpl myDelegate; private final int myBuildTargetId; diff --git a/platform/lang-impl/src/com/intellij/lang/pratt/MutableMarker.java b/platform/lang-impl/src/com/intellij/lang/pratt/MutableMarker.java index e831649c6bd1..4a64bf719663 100644 --- a/platform/lang-impl/src/com/intellij/lang/pratt/MutableMarker.java +++ b/platform/lang-impl/src/com/intellij/lang/pratt/MutableMarker.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.lang.pratt; -import com.intellij.lang.LighterASTNode; import com.intellij.lang.PsiBuilder; import com.intellij.openapi.util.NlsContexts; import com.intellij.psi.tree.IElementType; @@ -22,7 +21,7 @@ public class MutableMarker { myPath = path; myStartMarker = startMarker; myInitialPathLength = initialPathLength; - myMode = startMarker instanceof LighterASTNode && ((LighterASTNode)startMarker).getTokenType() != null? Mode.COMMITTED : Mode.READY; + myMode = startMarker != null && startMarker.getTokenType() != null ? Mode.COMMITTED : Mode.READY; } // for easier transition only @@ -30,7 +29,7 @@ public class MutableMarker { myPath = path; myStartMarker = (PsiBuilder.Marker)builder.getLatestDoneMarker(); myInitialPathLength = path.size(); - myResultType = myStartMarker != null ? ((LighterASTNode)myStartMarker).getTokenType() : null; + myResultType = myStartMarker != null ? myStartMarker.getTokenType() : null; myMode = myResultType != null ? Mode.COMMITTED : Mode.READY; } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeDetectionService.java b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeDetectionService.java index d0bde4ca8b51..fff5f7be49ec 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeDetectionService.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeDetectionService.java @@ -17,7 +17,6 @@ import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.io.ByteArraySequence; -import com.intellij.openapi.util.io.ByteSequence; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.FileUtilRt; import com.intellij.openapi.util.text.StringUtil; @@ -546,7 +545,7 @@ final class FileTypeDetectionService implements Disposable { file, true, true, PlainTextFileType.INSTANCE, (@Nullable CharSequence text) -> { if (toLog()) { - log("F: detectFromContentAndCache.processFirstBytes(" + file.getName() + "): bytes length=" + ((ByteSequence)bytes).length() + + log("F: detectFromContentAndCache.processFirstBytes(" + file.getName() + "): bytes length=" + bytes.length() + "; isText=" + (text != null) + "; text='" + (text == null ? null : StringUtil.first(text, 100, true)) + "'" + ", detectors=" + detectors); } @@ -651,7 +650,7 @@ final class FileTypeDetectionService implements Disposable { if (!file.isCharsetSet()) { // when detecting type from content of a file with unknown charset we have to determine charset first, // which in turn may require file content. But in this case, the whole file content because the UTF surrogates may very well be at the end of the file. - return FileUtilRt.getUserContentLoadLimit(); + return FileUtilRt.getUserContentLoadLimit(); } int bufferLength = cachedDetectFileBufferSize; if (bufferLength == -1) { diff --git a/platform/platform-impl/src/com/intellij/openapi/roots/ui/util/JarSubfileCellAppearance.java b/platform/platform-impl/src/com/intellij/openapi/roots/ui/util/JarSubfileCellAppearance.java index 1ae6f8ff8c05..9ca382191dbe 100644 --- a/platform/platform-impl/src/com/intellij/openapi/roots/ui/util/JarSubfileCellAppearance.java +++ b/platform/platform-impl/src/com/intellij/openapi/roots/ui/util/JarSubfileCellAppearance.java @@ -2,7 +2,6 @@ package com.intellij.openapi.roots.ui.util; import com.intellij.ide.highlighter.ArchiveFileType; -import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.ApiStatus; @@ -17,7 +16,7 @@ public final class JarSubfileCellAppearance extends ValidFileCellAppearance { @Override protected Icon getIcon() { - return ((FileType)ArchiveFileType.INSTANCE).getIcon(); + return ArchiveFileType.INSTANCE.getIcon(); } @Override diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/dev/content/ContentHashEnumeratorOverDurableEnumerator.java b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/dev/content/ContentHashEnumeratorOverDurableEnumerator.java index a7fd8fd7bc77..c25cf6e8a0eb 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/dev/content/ContentHashEnumeratorOverDurableEnumerator.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/dev/content/ContentHashEnumeratorOverDurableEnumerator.java @@ -1,15 +1,14 @@ // Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.openapi.vfs.newvfs.persistent.dev.content; +import com.intellij.platform.util.io.storages.DataExternalizerEx; +import com.intellij.platform.util.io.storages.KeyDescriptorEx; import com.intellij.platform.util.io.storages.appendonlylog.AppendOnlyLogFactory; import com.intellij.platform.util.io.storages.appendonlylog.AppendOnlyLogOverMMappedFile; -import com.intellij.platform.util.io.storages.DataExternalizerEx; import com.intellij.platform.util.io.storages.enumerator.DurableEnumerator; import com.intellij.platform.util.io.storages.enumerator.DurableEnumeratorFactory; -import com.intellij.platform.util.io.storages.KeyDescriptorEx; import com.intellij.util.hash.ContentHashEnumerator; import com.intellij.util.io.CleanableStorage; -import com.intellij.util.io.ScannableDataEnumeratorEx; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -96,14 +95,14 @@ public class ContentHashEnumeratorOverDurableEnumerator implements ContentHashEn @Override public boolean forEach(@NotNull ValueReader reader) throws IOException { - return ((ScannableDataEnumeratorEx)enumerator).forEach( + return enumerator.forEach( (enumeratorId, hash) -> reader.read(enumeratorIdToHashId(enumeratorId), hash) ); } @Override public int recordsCount() throws IOException { - return ((ScannableDataEnumeratorEx)enumerator).recordsCount(); + return enumerator.recordsCount(); } @Override @@ -204,7 +203,7 @@ public class ContentHashEnumeratorOverDurableEnumerator implements ContentHashEn } @Override - public KnownSizeRecordWriter writerFor(byte @NotNull [] hash) throws IOException { + public KnownSizeRecordWriter writerFor(byte @NotNull [] hash) { return DataExternalizerEx.fromBytes(hash); } diff --git a/platform/util/concurrency/src/com/intellij/concurrency/ConcurrentIntKeyRefValueHashMap.java b/platform/util/concurrency/src/com/intellij/concurrency/ConcurrentIntKeyRefValueHashMap.java index 539a2295e51e..3daf25de3646 100644 --- a/platform/util/concurrency/src/com/intellij/concurrency/ConcurrentIntKeyRefValueHashMap.java +++ b/platform/util/concurrency/src/com/intellij/concurrency/ConcurrentIntKeyRefValueHashMap.java @@ -152,7 +152,7 @@ abstract class ConcurrentIntKeyRefValueHashMap implements ConcurrentIntObject @NotNull private Iterator> entriesIterator() { - final Iterator>> entryIterator = ((Iterable>>)myMap.entrySet()).iterator(); + final Iterator>> entryIterator = myMap.entrySet().iterator(); return new Iterator<>() { private Entry nextVEntry; private Entry> nextReferenceEntry; diff --git a/platform/util/jdom/src/org/jdom/filter/ElementFilter.java b/platform/util/jdom/src/org/jdom/filter/ElementFilter.java index ddf1afdf02da..3024325cb028 100644 --- a/platform/util/jdom/src/org/jdom/filter/ElementFilter.java +++ b/platform/util/jdom/src/org/jdom/filter/ElementFilter.java @@ -59,6 +59,8 @@ package org.jdom.filter; import org.jdom.Element; import org.jdom.Namespace; +import java.util.Objects; + /** * @deprecated Use {@link org.jdom.filter2.ElementFilter} */ @@ -139,12 +141,7 @@ public final class ElementFilter extends AbstractFilter { if (!(obj instanceof ElementFilter)) return false; final ElementFilter filter = (ElementFilter)obj; - - //noinspection StringEquality - if (!((name == filter.name) || (name != null && ((Object)name).equals(filter.name)))) return false; - if (!((namespace == filter.namespace) || (namespace != null && ((Object)namespace).equals(filter.namespace)))) return false; - - return true; + return Objects.equals(name, filter.name) && Objects.equals(namespace, filter.namespace); } public int hashCode() { diff --git a/platform/util/src/com/intellij/util/containers/ConcurrentIntKeyRefValueHashMap.java b/platform/util/src/com/intellij/util/containers/ConcurrentIntKeyRefValueHashMap.java index f45579676945..eeb486e6329b 100644 --- a/platform/util/src/com/intellij/util/containers/ConcurrentIntKeyRefValueHashMap.java +++ b/platform/util/src/com/intellij/util/containers/ConcurrentIntKeyRefValueHashMap.java @@ -143,7 +143,7 @@ abstract class ConcurrentIntKeyRefValueHashMap implements ConcurrentIntObject } private @NotNull Iterator> entriesIterator() { - Iterator>> entryIterator = ((Iterable>>)myMap.entrySet()).iterator(); + Iterator>> entryIterator = myMap.entrySet().iterator(); return new Iterator>() { private Entry nextVEntry; private Entry> nextReferenceEntry; diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenKeymapExtension.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenKeymapExtension.java index d35c33a5dc22..c9995679fab2 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenKeymapExtension.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenKeymapExtension.java @@ -108,7 +108,7 @@ public final class MavenKeymapExtension implements ExternalSystemKeymapExtension return result; } - static void updateActions(Project project, List mavenProjects) { + static void updateActions(Project project, List mavenProjects) { clearActions(project, mavenProjects); createActions(project, mavenProjects); } @@ -124,7 +124,7 @@ public final class MavenKeymapExtension implements ExternalSystemKeymapExtension return mavenGoalAction; } - private static void createActions(Project project, List mavenProjects) { + private static void createActions(Project project, List mavenProjects) { ActionManager actionManager = ActionManager.getInstance(); MavenShortcutsManager shortcutsManager = MavenShortcutsManager.getInstance(project); @@ -163,7 +163,7 @@ public final class MavenKeymapExtension implements ExternalSystemKeymapExtension } } - static void clearActions(Project project, List mavenProjects) { + static void clearActions(Project project, List mavenProjects) { ActionManager manager = ActionManager.getInstance(); for (MavenProject eachProject : mavenProjects) { for (String eachAction : getActionIdList(project, eachProject)) { @@ -187,7 +187,7 @@ public final class MavenKeymapExtension implements ExternalSystemKeymapExtension if (info == null) continue; for (MavenPluginInfo.Mojo m : info.getMojos()) { - ((Set)result).add(m.getQualifiedGoal()); + result.add(m.getQualifiedGoal()); } } diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenShortcutsManager.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenShortcutsManager.java index 8f3ce9e7d2a7..34256ebd6421 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenShortcutsManager.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/tasks/MavenShortcutsManager.java @@ -155,13 +155,13 @@ public final class MavenShortcutsManager implements Disposable { } @Override - public void projectsIgnoredStateChanged(List ignored, List unignored, boolean fromImport) { + public void projectsIgnoredStateChanged(@NotNull List ignored, @NotNull List unignored, boolean fromImport) { scheduleKeymapUpdate(unignored, true); scheduleKeymapUpdate(ignored, false); } @Override - public void projectsUpdated(List> updated, List deleted) { + public void projectsUpdated(@NotNull List> updated, @NotNull List deleted) { scheduleKeymapUpdate(MavenUtil.collectFirsts(updated), true); scheduleKeymapUpdate(deleted, false); } @@ -176,7 +176,7 @@ public final class MavenShortcutsManager implements Disposable { scheduleKeymapUpdate(Collections.singletonList(project), true); } - private void scheduleKeymapUpdate(List mavenProjects, boolean forUpdate) { + private void scheduleKeymapUpdate(List mavenProjects, boolean forUpdate) { synchronized (mySheduledProjects) { for (MavenProject each : mavenProjects) { mySheduledProjects.put(each, forUpdate); diff --git a/plugins/yaml/src/org/jetbrains/yaml/navigation/YAMLKeysSearchEverywhereContributor.java b/plugins/yaml/src/org/jetbrains/yaml/navigation/YAMLKeysSearchEverywhereContributor.java index 0833d15915d1..5970f0324182 100644 --- a/plugins/yaml/src/org/jetbrains/yaml/navigation/YAMLKeysSearchEverywhereContributor.java +++ b/plugins/yaml/src/org/jetbrains/yaml/navigation/YAMLKeysSearchEverywhereContributor.java @@ -16,7 +16,6 @@ import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.util.NlsSafe; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.pom.Navigatable; import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.search.ProjectScope; import com.intellij.util.Plow; @@ -78,7 +77,7 @@ public class YAMLKeysSearchEverywhereContributor implements SearchEverywhereCont @Override public boolean processSelectedItem(@NotNull YAMLKeyNavigationItem selected, int modifiers, @NotNull String searchText) { - ((Navigatable)selected).navigate(true); + selected.navigate(true); return true; } diff --git a/python/src/com/jetbrains/python/debugger/PyUnitTestsDebuggingService.java b/python/src/com/jetbrains/python/debugger/PyUnitTestsDebuggingService.java index adf7b8e47f4d..25059b64c75d 100644 --- a/python/src/com/jetbrains/python/debugger/PyUnitTestsDebuggingService.java +++ b/python/src/com/jetbrains/python/debugger/PyUnitTestsDebuggingService.java @@ -25,6 +25,7 @@ import com.intellij.ui.AppUIUtil; import com.intellij.ui.Gray; import com.intellij.ui.JBColor; import com.intellij.util.Consumer; +import com.intellij.util.containers.ContainerUtil; import com.intellij.util.ui.NamedColorUtil; import com.intellij.util.ui.UIUtil; import com.intellij.xdebugger.XDebugSession; @@ -134,7 +135,7 @@ final class PyUnitTestsDebuggingService { */ public static boolean isErrorInTestSetUpOrTearDown(@NotNull List frames) { for (PyStackFrameInfo frameInfo : frames) { - if (SET_UP_AND_TEAR_DOWN_FUNCTIONS_BY_FRAMEWORK.values().stream().anyMatch(names -> names.contains(frameInfo.getName()))) + if (ContainerUtil.exists(SET_UP_AND_TEAR_DOWN_FUNCTIONS_BY_FRAMEWORK.values(), names -> names.contains(frameInfo.getName()))) return true; } return false; @@ -210,7 +211,7 @@ final class PyUnitTestsDebuggingService { return UIUtil.getFontWithFallback(fontName, Font.PLAIN, fontSize); } - private void drawStringToInlayBox(@NotNull String str, @NotNull Inlay inlay, @NotNull Graphics g, @NotNull Rectangle targetRegion) { + private void drawStringToInlayBox(@NotNull String str, @NotNull Inlay inlay, @NotNull Graphics g, @NotNull Rectangle targetRegion) { g.drawString(str, targetRegion.x + INLAY_TEXT_INDENT, targetRegion.y + inlay.getEditor().getLineHeight() * myCurrentLineNumber); myCurrentLineNumber++; } @@ -240,7 +241,7 @@ final class PyUnitTestsDebuggingService { } private static @NotNull Color getInlayBackgroundColor() { - return UIUtil.isUnderDarcula() ? JBColor.WHITE : new JBColor(Gray._240, Gray._192); + return JBColor.isBright() ? new JBColor(Gray._240, Gray._192) : JBColor.WHITE; } private static @Nls String getFailedTestCaption() { @@ -277,7 +278,7 @@ final class PyUnitTestsDebuggingService { @Override public int hashCode() { - return ((Object)this).hashCode(); + return System.identityHashCode(this); } } } diff --git a/tools/launcher-generator/src/com/pme/exe/ExeReader.java b/tools/launcher-generator/src/com/pme/exe/ExeReader.java index 38a134fba1b4..dc30556ccca1 100644 --- a/tools/launcher-generator/src/com/pme/exe/ExeReader.java +++ b/tools/launcher-generator/src/com/pme/exe/ExeReader.java @@ -73,7 +73,7 @@ public class ExeReader extends Bin.Structure { long result = 0; long lastVA = 0; for (ImageSectionHeader header : mySectionHeaders) { - long va = ((Value)header.getVirtualAddress()).getValue(); + long va = header.getVirtualAddress().getValue(); if (lastVA < va) { result = header.getVirtualSize().getValue() + va; } diff --git a/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java b/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java index 547c424b7639..c6144bc113f4 100644 --- a/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java +++ b/xml/dom-tests/tests/com/intellij/util/xml/ProxyTest.java @@ -170,6 +170,7 @@ public class ProxyTest extends TestCase { }, false, ArrayUtilRt.EMPTY_OBJECT_ARRAY); assertEquals("a", proxy.sayA()); assertEquals("a", ((CovariantFromBaseClassTest.Base)proxy).sayA()); + //noinspection RedundantCast assertEquals("a", ((CovariantFromBaseClassTest.Intf)proxy).sayA()); }