Pattern variable can be used mass cleanup

GitOrigin-RevId: 55839bf0deca5f81d0f7eb5b1c190145a5ea0037
This commit is contained in:
Tagir Valeev
2023-02-07 13:24:01 +01:00
committed by intellij-monorepo-bot
parent daaa8e8930
commit f456ed0604
2270 changed files with 4362 additions and 8927 deletions

View File

@@ -225,9 +225,7 @@ public class PyJavaClassType implements PyClassLikeType {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof PyJavaClassType)) return false;
PyJavaClassType type = (PyJavaClassType)o;
if (!(o instanceof PyJavaClassType type)) return false;
if (myDefinition != type.myDefinition) return false;
if (myClass != null ? !myClass.equals(type.myClass) : type.myClass != null) return false;

View File

@@ -42,8 +42,7 @@ public class PyJavaTypeProvider extends PyTypeProviderBase {
@Nullable
public static PyType asPyType(@Nullable PsiType type) {
if (type instanceof PsiClassType) {
final PsiClassType classType = (PsiClassType)type;
if (type instanceof PsiClassType classType) {
final PsiClass psiClass = classType.resolve();
if (psiClass != null) {
return new PyJavaClassType(psiClass, false);
@@ -62,8 +61,7 @@ public class PyJavaTypeProvider extends PyTypeProviderBase {
if (index < 0) return null;
final List<PyType> superMethodParameterTypes = new ArrayList<>();
PySuperMethodsSearch.search(func, context).forEach(psiElement -> {
if (psiElement instanceof PsiMethod) {
final PsiMethod method = (PsiMethod)psiElement;
if (psiElement instanceof PsiMethod method) {
final PsiParameter[] psiParameters = method.getParameterList().getParameters();
int javaIndex = method.hasModifierProperty(PsiModifier.STATIC) ? index : index-1; // adjust for 'self' parameter
if (javaIndex < psiParameters.length) {