[java-inspection] IDEA-352587 Support JEP 455: Improve conversion from if to switch

GitOrigin-RevId: 30a1ee985af322459781882e4e792ecb6478ea67
This commit is contained in:
Mikhail Pyltsin
2024-05-24 20:57:45 +02:00
committed by intellij-monorepo-bot
parent f1642ef3bb
commit 5cdb566ad8
44 changed files with 816 additions and 33 deletions

View File

@@ -157,7 +157,7 @@ public final class PsiPrimitiveType extends PsiType.Stub implements JvmPrimitive
* @return the primitive type, or null if the type does not represent a boxed primitive type.
*/
@Nullable
public static PsiPrimitiveType getUnboxedType(PsiType type) {
public static PsiPrimitiveType getUnboxedType(@Nullable PsiType type) {
if (!(type instanceof PsiClassType)) return null;
PsiUtil.ensureValidType(type);
@@ -174,7 +174,7 @@ public final class PsiPrimitiveType extends PsiType.Stub implements JvmPrimitive
}
@Nullable
public static PsiPrimitiveType getOptionallyUnboxedType(PsiType type) {
public static PsiPrimitiveType getOptionallyUnboxedType(@Nullable PsiType type) {
return type instanceof PsiPrimitiveType ? (PsiPrimitiveType)type : getUnboxedType(type);
}