mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
propagate @Unmodifiable to more methods calling ContainerUtil, to enable data-flow inspection to highlight more warnings
GitOrigin-RevId: 01d3c976ffd35c3290433d0cd6c0f2d59df894f1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bb89f5029b
commit
9cef099839
@@ -4,6 +4,7 @@ package com.intellij.codeInspection.reference;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
import org.jetbrains.uast.UClass;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -29,6 +30,7 @@ public interface RefClass extends RefJavaElement, RefOverridable {
|
||||
List<RefMethod> getConstructors();
|
||||
|
||||
/** @return the fields of this class */
|
||||
@Unmodifiable
|
||||
default List<RefField> getFields() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.intellij.codeInspection.reference;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
import org.jetbrains.uast.UExpression;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,6 +16,7 @@ public interface RefFunctionalExpression extends RefJavaElement, RefOverridable
|
||||
* @return list of parameters of the functional expression
|
||||
*/
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
List<RefParameter> getParameters();
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.psi.PsiModifierListOwner;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
import org.jetbrains.uast.UMethod;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -33,6 +34,7 @@ public interface RefMethod extends RefJavaElement, RefOverridable {
|
||||
*
|
||||
* @return the collection of overriding methods.
|
||||
*/
|
||||
@Unmodifiable
|
||||
@NotNull Collection<RefMethod> getDerivedMethods();
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.intellij.lang.jvm.actions;
|
||||
import com.intellij.lang.jvm.JvmParameter;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -46,6 +47,7 @@ public interface ChangeParametersRequest extends ActionRequest {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@Unmodifiable
|
||||
public Collection<AnnotationRequest> getExpectedAnnotations() {
|
||||
return ContainerUtil.mapNotNull(myExistingParameter.getAnnotations(), AnnotationRequestsKt::annotationRequest);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package com.intellij.lang.jvm.actions;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -23,6 +24,7 @@ public interface ExpectedParameter {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Unmodifiable
|
||||
default Collection<AnnotationRequest> getExpectedAnnotations() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user