From c6236f15892d78f7fea261f8712ea9e98eaf8538 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 27 Feb 2013 16:08:57 +0100 Subject: [PATCH] move static method closer to its usage --- .../com/jetbrains/python/psi/types/PyClassTypeImpl.java | 7 ++++++- .../src/com/jetbrains/python/psi/types/PyTypeChecker.java | 5 ----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java b/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java index 14adb35a719c..f010f522fc45 100644 --- a/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java +++ b/python/src/com/jetbrains/python/psi/types/PyClassTypeImpl.java @@ -225,7 +225,7 @@ public class PyClassTypeImpl extends UserDataHolderBase implements PyClassType { if (isDefinition()) { return true; } - if (PyTypeChecker.isMethodType(this)) { + if (isMethodType(this)) { return true; } final PyClass cls = getPyClass(); @@ -235,6 +235,11 @@ public class PyClassTypeImpl extends UserDataHolderBase implements PyClassType { return false; } + private static boolean isMethodType(@NotNull PyClassType type) { + final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(type.getPyClass()); + return type.equals(builtinCache.getClassMethodType()) || type.equals(builtinCache.getStaticMethodType()); + } + @Nullable @Override public PyType getCallType(@NotNull TypeEvalContext context, @Nullable PyQualifiedExpression callSite) { diff --git a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java index 5037de76a225..50b05c8abac5 100644 --- a/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java +++ b/python/src/com/jetbrains/python/psi/types/PyTypeChecker.java @@ -446,11 +446,6 @@ public class PyTypeChecker { return false; } - public static boolean isMethodType(@NotNull PyClassType type) { - final PyBuiltinCache builtinCache = PyBuiltinCache.getInstance(type.getPyClass()); - return type.equals(builtinCache.getClassMethodType()) || type.equals(builtinCache.getStaticMethodType()); - } - /** * Hack for skipping type checking for method calls of union members if there are several call alternatives. *