compat/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/reflection/ClassMap.java [243:295]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static int getAccessibleMethods(Class<?> clazz, MethodInfo[] methodInfos, int upcastCount) {
        int l = methodInfos.length;

        // if this class is public, then check each of the currently
        // 'non-upcasted' methods to see if we have a match
        if (Modifier.isPublic(clazz.getModifiers())) {
            for (int i = 0; i < l && upcastCount < l; ++i) {
                try {
                    MethodInfo methodInfo = methodInfos[i];
                    if (!methodInfo.upcast) {
                        methodInfo.tryUpcasting(clazz);
                        upcastCount++;
                    }
                } catch (NoSuchMethodException e) {
                    // Intentionally ignored - it means it wasn't found in the current class
                }
            }

            /*
             *  Short circuit if all methods were upcast
             */

            if (upcastCount == l) {
                return upcastCount;
            }
        }

        // Examine superclass
        Class<?> superclazz = clazz.getSuperclass();
        if (superclazz != null) {
            upcastCount = getAccessibleMethods(superclazz, methodInfos, upcastCount);

            // Short circuit if all methods were upcast
            if (upcastCount == l) {
                return upcastCount;
            }
        }

        // Examine interfaces. Note we do it even if superclazz == null.
        // This is redundant as currently java.lang.Object does not implement
        // any interfaces, however nothing guarantees it will not in the future.
        Class<?>[] interfaces = clazz.getInterfaces();
        for (int i = interfaces.length; i-- > 0; ) {
            upcastCount = getAccessibleMethods(interfaces[i], methodInfos, upcastCount);

            // Short circuit if all methods were upcast
            if (upcastCount == l) {
                return upcastCount;
            }
        }

        return upcastCount;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



impl/maven-impl/src/main/java/org/apache/maven/impl/model/reflection/ClassMap.java [240:292]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private static int getAccessibleMethods(Class<?> clazz, MethodInfo[] methodInfos, int upcastCount) {
        int l = methodInfos.length;

        // if this class is public, then check each of the currently
        // 'non-upcasted' methods to see if we have a match
        if (Modifier.isPublic(clazz.getModifiers())) {
            for (int i = 0; i < l && upcastCount < l; ++i) {
                try {
                    MethodInfo methodInfo = methodInfos[i];
                    if (!methodInfo.upcast) {
                        methodInfo.tryUpcasting(clazz);
                        upcastCount++;
                    }
                } catch (NoSuchMethodException e) {
                    // Intentionally ignored - it means it wasn't found in the current class
                }
            }

            /*
             *  Short circuit if all methods were upcast
             */

            if (upcastCount == l) {
                return upcastCount;
            }
        }

        // Examine superclass
        Class<?> superclazz = clazz.getSuperclass();
        if (superclazz != null) {
            upcastCount = getAccessibleMethods(superclazz, methodInfos, upcastCount);

            // Short circuit if all methods were upcast
            if (upcastCount == l) {
                return upcastCount;
            }
        }

        // Examine interfaces. Note we do it even if superclazz == null.
        // This is redundant as currently java.lang.Object does not implement
        // any interfaces, however nothing guarantees it will not in the future.
        Class<?>[] interfaces = clazz.getInterfaces();
        for (int i = interfaces.length; i-- > 0; ) {
            upcastCount = getAccessibleMethods(interfaces[i], methodInfos, upcastCount);

            // Short circuit if all methods were upcast
            if (upcastCount == l) {
                return upcastCount;
            }
        }

        return upcastCount;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



