Method (@NotNull ReferenceType refType, @NonNls String methodName, @Nullable @NonNls String methodSignature) { if (refType instanceof ArrayType) { // for array types methodByName() in JDI always returns empty list Method method = findMethod(getObjectClassType(refType.virtualMachine()), methodName, methodSignature); if (method != null) { return method; } // for arrays, clone signature may return array of objects, there is no such method in Object class if ("clone".equals(methodName) && "()[Ljava/lang/Object;".equals(methodSignature)) { method = findMethod(getObjectClassType(refType.virtualMachine()), "clone", null); if (method != null) { return method; } } } Method method = null; // speedup the search by not gathering all methods through the class hierarchy if (refType instanceof ClassType) { method = concreteMethodByName((ClassType)refType, methodName, methodSignature); } if (method == null) { method = ContainerUtil.getFirstItem( methodSignature != null ? refType.methodsByName(methodName, methodSignature) : refType.methodsByName(methodName)); } return method; }