From becb0096fbf5493d0f6c40d0bea4a458cac45ff7 Mon Sep 17 00:00:00 2001 From: Julia Beliaeva Date: Mon, 27 May 2024 16:58:27 +0200 Subject: [PATCH] [lvcs] cleanup: check parameter class in the equals method GitOrigin-RevId: 072bcff22001d9f98289909fd4d60fdb454f509f --- .../src/com/intellij/history/core/StoredContent.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/core/StoredContent.java b/platform/lvcs-impl/src/com/intellij/history/core/StoredContent.java index bdf28f83de31..4102c3a02fdd 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/StoredContent.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/StoredContent.java @@ -1,4 +1,4 @@ -// Copyright 2000-2019 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. +// 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.history.core; @@ -89,7 +89,9 @@ public class StoredContent extends Content { @Override public boolean equals(Object o) { - return myContentId == ((StoredContent)o).myContentId; + if (this == o) return true; + if (!(o instanceof StoredContent content)) return false; + return myContentId == content.myContentId; } @Override