boolean (@Nullable PsiMethod method) { if (method == null) { return false; } final PsiClassType javaLangObject; if (!PsiUtil.isLanguageLevel5OrHigher(method)) { javaLangObject = TypeUtils.getObjectType(method); } else { // for 1.5 and after, clone may be covariant if (method.getReturnType() instanceof PsiPrimitiveType) { return false; } javaLangObject = null; } return MethodUtils.methodMatches(method, null, javaLangObject, HardcodedMethodConstants.CLONE, PsiType.EMPTY_ARRAY); }