}
@Nullable
- public static Method findMethod(ReferenceType refType, @NonNls String methodName, @NonNls String methodSignature) {
+ public static Method findMethod(@NotNull ReferenceType refType, @NonNls String methodName, @NonNls String methodSignature) {
if (refType instanceof ArrayType) {
// for array types methodByName() in JDI always returns empty list
final Method method = findMethod(refType.virtualMachine().classesByName(CommonClassNames.JAVA_LANG_OBJECT).get(0), methodName, methodSignature);
return false;
}
- public static Type getSuperType(@NotNull Type subType, @NotNull String superType) {
- if(CommonClassNames.JAVA_LANG_OBJECT.equals(superType)) {
+ @Nullable
+ public static Type getSuperType(@Nullable Type subType, @NotNull String superType) {
+ if (subType == null) return null;
+
+ if (CommonClassNames.JAVA_LANG_OBJECT.equals(superType)) {
List list = subType.virtualMachine().classesByName(CommonClassNames.JAVA_LANG_OBJECT);
if(list.size() > 0) {
return (ReferenceType)list.get(0);
return type.name().replace('$', '.').equals(typeName.replace('$', '.'));
}
- private static Type getSuperTypeInt(@Nullable Type subType, @NotNull String superType) {
- Type result;
- if (subType == null) {
- return null;
- }
-
+ private static Type getSuperTypeInt(@NotNull Type subType, @NotNull String superType) {
if (typeEquals(subType, superType)) {
return subType;
}
+ Type result;
if (subType instanceof ClassType) {
try {
- final ClassType clsType = (ClassType)subType;
+ ClassType clsType = (ClassType)subType;
result = getSuperType(clsType.superclass(), superType);
if (result != null) {
return result;
return null;
}
- public static boolean instanceOf(@NotNull Type subType, @NotNull String superType) {
+ public static boolean instanceOf(@Nullable Type subType, @NotNull String superType) {
return getSuperType(subType, superType) != null;
}