ClassNameUtils { public static boolean compareArgumentType( List<String> arguments, List<String> parameters, boolean hasVarargs) { if (!parameters.isEmpty() && arguments.size() >= parameters.size() && hasVarargs) { return compareVarArgumentType(arguments, parameters); } int aSize = arguments.size(); int pSize = parameters.size(); if (aSize != pSize) { return false; } Iterator<String> iteratorA = arguments.iterator(); CachedASMReflector reflector = CachedASMReflector.getInstance(); for (String paramStr : parameters) { String realArgStr = iteratorA.next(); if (isNull(realArgStr)) { return false; } if (realArgStr.equals("<null>")) { continue; } if (ClassNameUtils.isArray(paramStr) != ClassNameUtils.isArray(realArgStr)) { return false; } if (paramStr.startsWith(ClassNameUtils.CLASS_TYPE_VARIABLE_MARK)) { continue; } String paramClassName = autoBoxing(ClassNameUtils.getClassName(paramStr)); String argClassName = autoBoxing(ClassNameUtils.getClassName(realArgStr)); if (paramClassName.equals(argClassName)) { continue; } if (implicitTypeCastMap.containsKey(argClassName)) { Set<String> types = implicitTypeCastMap.get(argClassName); if (types.contains(paramClassName)) { continue; } } boolean result = reflector .getSuperClassStream(argClassName) .anyMatch(s -> ClassNameUtils.getClassName(s).equals(paramClassName)); if (!result) { return false; } } return true; } private  ClassNameUtils(); static boolean isPrimitive(final String className); static boolean isArray(final String name); static String replaceFromMap(final String string, final Map<String, String> replacements); static String replaceDot2FileSep(final String string); static String replaceSlash(String string); static String getParentClass(final String name); static String replaceInnerMark(final String string); static String replaceDotToInnerMark(String string, boolean last); static String removeTypeMark(final String val); static Optional<String> toInnerClassName(final String name); static boolean hasPackage(String name); static String getSimpleName(final String fqcn); static String getPackage(final String fqcn); static Optional<String> getTypeVariable(final String val); static String removeTypeParameter(String name); static String removeTypeAndArray(String name); static List<String> parseTypeParameter(final String str); static String removeCapture(final String name); static String removeCaptureAndWildCard(final String name); static String getAllSimpleName(final String name); static String removeWildcard(final String name); static boolean compareArgumentType(
      List<String> arguments, List<String> parameters, boolean hasVarargs); static boolean isAnonymousClass(final String name); static void replaceDescriptorsType(
      final String nameWithTP, final List<MemberDescriptor> members); static String getClassName(final String s); static final String OBJECT_CLASS; static final String OBJECT; static final String CLASS_TYPE_VARIABLE_MARK; static final String FORMAL_TYPE_VARIABLE_MARK; static final String INNER_MARK; static final String CAPTURE_OF; static final String ARRAY; }
@Test public void compareArgumentType1() { List<String> arg1 = new ArrayList<>(); arg1.add("boolean"); arg1.add("java.lang.String"); List<String> arg2 = new ArrayList<>(); arg2.add("boolean"); arg2.add("java.lang.String"); boolean b = ClassNameUtils.compareArgumentType(arg1, arg2, false); assertEquals(true, b); }
@Test public void compareArgumentType2() { List<String> arg1 = new ArrayList<>(); arg1.add("boolean"); arg1.add("java.lang.String"); List<String> arg2 = new ArrayList<>(); arg2.add("boolean"); arg2.add("java.lang.String[]"); boolean b = ClassNameUtils.compareArgumentType(arg1, arg2, false); assertEquals(false, b); }
@Test public void compareArgumentType3() { List<String> arg1 = new ArrayList<>(); arg1.add("boolean"); arg1.add("java.lang.String"); List<String> arg2 = new ArrayList<>(); arg2.add("boolean"); arg2.add("java.lang.String[]"); boolean b = ClassNameUtils.compareArgumentType(arg1, arg2, true); assertEquals(true, b); }