[cleanup] remove redundant 'NonExtendable' and 'OverrideOnly' and add to ZTI

These new warnings were found by the updated inspections for NonExtendable and OverrideOnly annotations

Merge-request: IJ-MR-157790
Merged-by: Bartek Pacia <bartek.pacia@jetbrains.com>

GitOrigin-RevId: 2e7e2262515191a5f96e06381d0e359ec595e053
This commit is contained in:
Bartek Pacia
2025-03-23 17:51:28 +00:00
committed by intellij-monorepo-bot
parent ced3ae6cd3
commit 3cb8fce1d9
12 changed files with 5 additions and 21 deletions
+2 -2
View File
@@ -2638,7 +2638,7 @@
</inspection_tool>
<inspection_tool class="NonDefaultConstructor" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="NonExceptionNameEndsWithException" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NonExtendableApiUsage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NonExtendableApiUsage" enabled="true" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NonFinalClone" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NonFinalFieldInEnum" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="NonFinalFieldInImmutable" enabled="false" level="WARNING" enabled_by_default="false" />
@@ -2777,7 +2777,7 @@
</inspection_tool>
<inspection_tool class="OverridableMethodCallDuringObjectConstruction" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverriddenMethodCallDuringObjectConstruction" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverrideOnly" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverrideOnly" enabled="true" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverridingDeprecatedMember" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="OverwrittenKey" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PackageAccessibility" enabled="false" level="ERROR" enabled_by_default="false" />
@@ -32,7 +32,6 @@ import com.intellij.util.containers.ConcurrentFactoryMap;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.messages.MessageBus;
import kotlinx.coroutines.CoroutineScope;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -40,7 +39,6 @@ import java.util.*;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Predicate;
@ApiStatus.NonExtendable
public final class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
private static final Logger LOG = Logger.getInstance(JavaPsiFacadeImpl.class);
@@ -27,7 +27,6 @@ import java.util.concurrent.atomic.AtomicReference;
* Use {@link AnnotationHolder} instead. The members of this class can suddenly change or disappear.
*/
@ApiStatus.Internal
@ApiStatus.NonExtendable
public final class AnnotationHolderImpl extends SmartList<@NotNull Annotation> implements AnnotationHolder {
private static final Logger LOG = Logger.getInstance(AnnotationHolderImpl.class);
private final AnnotationSession myAnnotationSession;
+1 -1
View File
@@ -46,7 +46,7 @@ f:com.intellij.openapi.actionSystem.CompositeDataProvider
- getData(java.lang.String):java.lang.Object
com.intellij.openapi.actionSystem.DataContext
- sf:EMPTY_CONTEXT:com.intellij.openapi.actionSystem.DataContext
- F:getData(com.intellij.openapi.actionSystem.DataKey):java.lang.Object
- getData(com.intellij.openapi.actionSystem.DataKey):java.lang.Object
f:com.intellij.openapi.actionSystem.DataKey
- com.intellij.openapi.util.ValueKey
- sf:Companion:com.intellij.openapi.actionSystem.DataKey$Companion
@@ -47,7 +47,6 @@ public interface DataContext {
*
* @param dataId the data identifier for which the value is requested.
* @return the value, or null if no value is available in the current context for this identifier.
*
* @deprecated Always use {@link #getData(DataKey)} instead.
*/
@Deprecated(forRemoval = true)
@@ -63,7 +62,6 @@ public interface DataContext {
* @param key the data key for which the value is requested.
* @return the value, or null if no value is available in the current context for this identifier.
*/
@ApiStatus.NonExtendable
default @Nullable <T> T getData(@NotNull DataKey<T> key) {
//noinspection unchecked
return (T)getData(key.getName());
@@ -5,7 +5,6 @@ import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiElement;
import com.intellij.util.concurrency.annotations.RequiresBackgroundThread;
import com.intellij.util.concurrency.annotations.RequiresReadLock;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.ApiStatus.Internal;
import org.jetbrains.annotations.ApiStatus.OverrideOnly;
import org.jetbrains.annotations.NotNull;
@@ -33,7 +32,6 @@ public interface PsiDocumentationTargetProvider {
* or {@code null} if this provider is not aware of the given element
* @see com.intellij.lang.documentation.DocumentationProvider#generateDoc
*/
@ApiStatus.OverrideOnly
@RequiresReadLock
@RequiresBackgroundThread(generateAssertion = false)
default @Nullable DocumentationTarget documentationTarget(@NotNull PsiElement element, @Nullable PsiElement originalElement) {
@@ -6255,7 +6255,7 @@ f:com.intellij.openapi.command.impl.StartMarkAction$AlreadyStartedException
- <init>(java.lang.String,com.intellij.openapi.editor.Document,com.intellij.openapi.command.undo.DocumentReference[]):V
- getAffectedDocuments():com.intellij.openapi.command.undo.DocumentReference[]
- getDocument():com.intellij.openapi.editor.Document
Ff:com.intellij.openapi.command.impl.UndoManagerImpl
f:com.intellij.openapi.command.impl.UndoManagerImpl
- com.intellij.openapi.command.undo.UndoManager
- s:ourNeverAskUser:Z
- addAffectedFiles(com.intellij.openapi.vfs.VirtualFile[]):V
@@ -86,22 +86,18 @@ abstract class InlineCompletionHandler @ApiStatus.Internal constructor(
* Frontend always starts a session. Backend never starts a session. Instead, the backend will send a notification to the frontend.
*/
@ApiStatus.Internal
@ApiStatus.NonExtendable
protected abstract fun startSessionOrNull(
request: InlineCompletionRequest,
provider: InlineCompletionProvider
): InlineCompletionSession?
@ApiStatus.Internal
@ApiStatus.NonExtendable
protected abstract fun doHide(context: InlineCompletionContext, finishType: FinishType)
@ApiStatus.Internal
@ApiStatus.NonExtendable
protected abstract fun createSessionManager(): InlineCompletionSessionManager
@ApiStatus.Internal
@ApiStatus.NonExtendable
protected abstract fun afterInsert(providerId: InlineCompletionProviderID)
fun addEventListener(listener: InlineCompletionEventListener) {
@@ -42,8 +42,6 @@ import org.jetbrains.annotations.TestOnly;
import java.util.*;
// Android team doesn't want to use new mockito for now, so, class cannot be final
@ApiStatus.NonExtendable
public final class UndoManagerImpl extends UndoManager {
private static final Logger LOG = Logger.getInstance(UndoManagerImpl.class);
+1 -1
View File
@@ -577,7 +577,7 @@ f:com.intellij.openapi.util.IntRef
- set(I):V
@:com.intellij.openapi.util.IntellijInternalApi
- java.lang.annotation.Annotation
Ff:com.intellij.openapi.util.InvalidDataException
f:com.intellij.openapi.util.InvalidDataException
- java.lang.RuntimeException
- <init>():V
- <init>(java.lang.String):V
@@ -1,10 +1,8 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.util;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
@ApiStatus.NonExtendable
public final class InvalidDataException extends RuntimeException {
public InvalidDataException() {
super();
@@ -30,7 +30,6 @@ import java.util.*;
import java.util.concurrent.ConcurrentMap;
// used externally
@ApiStatus.NonExtendable
public final class DomUtil {
public static final TypeVariable<Class<GenericValue>> GENERIC_VALUE_TYPE_VARIABLE = GenericValue.class.getTypeParameters()[0];
private static final Class<Void> DUMMY = void.class;