private String makeMethodKey()

in src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java [165:201]


    private String makeMethodKey(Method method) {
        Class<?>[] parameterTypes = method.getParameterTypes();

        StringBuilder methodKey = new StringBuilder(method.getName());

        for (Class<?> parameterType : parameterTypes) {
            /*
             * If the argument type is primitive then we want
             * to convert our primitive type signature to the
             * corresponding Object type so introspection for
             * methods with primitive types will work correctly.
             */
            if (parameterType.isPrimitive()) {
                if (parameterType.equals(Boolean.TYPE)) {
                    methodKey.append("java.lang.Boolean");
                } else if (parameterType.equals(Byte.TYPE)) {
                    methodKey.append("java.lang.Byte");
                } else if (parameterType.equals(Character.TYPE)) {
                    methodKey.append("java.lang.Character");
                } else if (parameterType.equals(Double.TYPE)) {
                    methodKey.append("java.lang.Double");
                } else if (parameterType.equals(Float.TYPE)) {
                    methodKey.append("java.lang.Float");
                } else if (parameterType.equals(Integer.TYPE)) {
                    methodKey.append("java.lang.Integer");
                } else if (parameterType.equals(Long.TYPE)) {
                    methodKey.append("java.lang.Long");
                } else if (parameterType.equals(Short.TYPE)) {
                    methodKey.append("java.lang.Short");
                }
            } else {
                methodKey.append(parameterType.getName());
            }
        }

        return methodKey.toString();
    }