mark PsiSubstitutor methods as pure to highlight unused results

This commit is contained in:
peter
2018-09-18 14:48:21 +02:00
parent bc30414ade
commit 4e2c4100d9
@@ -17,6 +17,7 @@ package com.intellij.psi;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.KeyWithDefaultValue;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -50,6 +51,7 @@ public interface PsiSubstitutor {
* @return the mapping for the type parameter, or {@code null} for a raw type.
*/
@Nullable
@Contract(pure = true)
PsiType substitute(@NotNull PsiTypeParameter typeParameter);
/**
@@ -59,10 +61,12 @@ public interface PsiSubstitutor {
* @param type the type to substitute the type parameters for.
* @return the result of the substitution.
*/
@Contract(pure = true)
PsiType substitute(@Nullable PsiType type);
//Should be used with great care, be sure to prevent infinite recursion that could arise
// from the use of recursively bounded type parameters
@Contract(pure = true)
PsiType substituteWithBoundsPromotion(@NotNull PsiTypeParameter typeParameter);
/**
@@ -74,6 +78,7 @@ public interface PsiSubstitutor {
* @return the new substitutor instance.
*/
@NotNull
@Contract(pure = true)
PsiSubstitutor put(@NotNull PsiTypeParameter classParameter, PsiType mapping);
/**
@@ -85,6 +90,7 @@ public interface PsiSubstitutor {
* @return the new substitutor instance.
*/
@NotNull
@Contract(pure = true)
PsiSubstitutor putAll(@NotNull PsiClass parentClass, PsiType[] mappings);
/**
@@ -95,6 +101,7 @@ public interface PsiSubstitutor {
* @return the new substitutor instance.
*/
@NotNull
@Contract(pure = true)
PsiSubstitutor putAll(@NotNull PsiSubstitutor another);
/**
@@ -103,6 +110,7 @@ public interface PsiSubstitutor {
* @return the substitution map instance.
*/
@NotNull
@Contract(pure = true)
Map<PsiTypeParameter, PsiType> getSubstitutionMap();
/**
@@ -111,6 +119,7 @@ public interface PsiSubstitutor {
* @return true if all types are valid, false otherwise.
* @see PsiType#isValid()
*/
@Contract(pure = true)
boolean isValid();
/**