compat/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/reflection/ClassMap.java [328:363]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static Method getPublicMethod(Class<?> clazz, String name, Class<?>... paramTypes) {
        // if this class is public, then try to get it
        if ((clazz.getModifiers() & Modifier.PUBLIC) != 0) {
            try {
                return clazz.getMethod(name, paramTypes);
            } catch (NoSuchMethodException e) {
                // If the class does not have the method, then neither its superclass
                // nor any of its interfaces has it so quickly return null.
                return null;
            }
        }

        //  try the superclass
        Class<?> superclazz = clazz.getSuperclass();

        if (superclazz != null) {
            Method superclazzMethod = getPublicMethod(superclazz, name, paramTypes);

            if (superclazzMethod != null) {
                return superclazzMethod;
            }
        }

        // and interfaces
        Class<?>[] interfaces = clazz.getInterfaces();

        for (Class<?> anInterface : interfaces) {
            Method interfaceMethod = getPublicMethod(anInterface, name, paramTypes);

            if (interfaceMethod != null) {
                return interfaceMethod;
            }
        }

        return null;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



impl/maven-impl/src/main/java/org/apache/maven/impl/model/reflection/ClassMap.java [325:360]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static Method getPublicMethod(Class<?> clazz, String name, Class<?>... paramTypes) {
        // if this class is public, then try to get it
        if ((clazz.getModifiers() & Modifier.PUBLIC) != 0) {
            try {
                return clazz.getMethod(name, paramTypes);
            } catch (NoSuchMethodException e) {
                // If the class does not have the method, then neither its superclass
                // nor any of its interfaces has it so quickly return null.
                return null;
            }
        }

        //  try the superclass
        Class<?> superclazz = clazz.getSuperclass();

        if (superclazz != null) {
            Method superclazzMethod = getPublicMethod(superclazz, name, paramTypes);

            if (superclazzMethod != null) {
                return superclazzMethod;
            }
        }

        // and interfaces
        Class<?>[] interfaces = clazz.getInterfaces();

        for (Class<?> anInterface : interfaces) {
            Method interfaceMethod = getPublicMethod(anInterface, name, paramTypes);

            if (interfaceMethod != null) {
                return interfaceMethod;
            }
        }

        return null;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



