mil.dod.th.word.htm.doclet/src/org/udri/doclet/msword/MSHTMLDoclet.java
private static MethodDoc findOverrideMethod(ClassDoc parentClass,
            MethodDoc method) {
        // First check all implementing interfaces for method
        for (ClassDoc iface : parentClass.interfaces()) {
            for (MethodDoc iFaceMethod : iface.methods()) {
                if (method.overrides(iFaceMethod)) {
                    return iFaceMethod;
                }
            }
        }

        // Then check super class, if there is one. Otherwise, we missed it.
        if (parentClass.superclass() != null) {
            for (MethodDoc superClassMethod : parentClass.superclass()
                    .methods()) {
                if (method.overrides(superClassMethod)) {
                    return superClassMethod;
                }
            }
        }

        // Restart the search with all interfaces
        for (ClassDoc iface : parentClass.interfaces()) {
            MethodDoc foundMethod = findOverrideMethod(iface, method);
            if (foundMethod != null) {
                return foundMethod;
            }
        }

        // No super class? Nowhere else to go, so return null.
        if (parentClass.superclass() == null) {
            return null;
        }

        // Nothing found. Restart with super class
        return findOverrideMethod(parentClass.superclass(), method);
    }
/**
     * Recurse up the inheritance tree for a method that has the override
     * annotation to reuse the comment. The search is breadth-first, checking
     * all interfaces of a containing class, then super class. If that is
     * fruitless, repeat with the super interfaces and then the super class (as
     * the containing class)
     * 
     * @param parentClass
     *            - the containing class of the methodDoc
     * @param method
     *            - the method with the <code>java.lang.Override</code>
     *            annotation
     * @return The overridden method. Null if not found.
     */
Recurse up the inheritance tree for a method that has the override
annotation to reuse the comment. The search is breadth-first, checking
all interfaces of a containing class, then super class. If that is
fruitless, repeat with the super interfaces and then the super class (as
the containing class)

@param parentClass
- the containing class of the methodDoc
@param method
- the method with the java.lang.Override
annotation
@return The overridden method. Null if not found.
Recurse up the inheritance tree for a method that has the override annotation to reuse the comment . The search is breadth - first checking all interfaces of a containing class then super class . If that is fruitless repeat with the super interfaces and then the super class ( as the containing class ) @param parentClass - the containing class of the methodDoc @param method - the method with the java . lang . Override annotation @return The overridden method . Null if not found .
private static MethodDoc findOverrideMethod(ClassDoc parentClass,
            MethodDoc method) {
        for (ClassDoc iface : parentClass.interfaces()) {
            for (MethodDoc iFaceMethod : iface.methods()) {
                if (method.overrides(iFaceMethod)) {
                    return iFaceMethod;
                }
            }
        }
        if (parentClass.superclass() != null) {
            for (MethodDoc superClassMethod : parentClass.superclass()
                    .methods()) {
                if (method.overrides(superClassMethod)) {
                    return superClassMethod;
                }
            }
        }
        for (ClassDoc iface : parentClass.interfaces()) {
            MethodDoc foundMethod = findOverrideMethod(iface, method);
            if (foundMethod != null) {
                return foundMethod;
            }
        }
        if (parentClass.superclass() == null) {
            return null;
        }
        return findOverrideMethod(parentClass.superclass(), method);
    }
private static MethodDoc findOverrideMethod ( ClassDoc parentClass , MethodDoc method ) { for ( ClassDoc iface : parentClass . interfaces ( ) ) { for ( MethodDoc iFaceMethod : iface . methods ( ) ) { if ( method . overrides ( iFaceMethod ) ) { return iFaceMethod ; } } } if ( parentClass . superclass ( ) != null ) { for ( MethodDoc superClassMethod : parentClass . superclass ( ) . methods ( ) ) { if ( method . overrides ( superClassMethod ) ) { return superClassMethod ; } } } for ( ClassDoc iface : parentClass . interfaces ( ) ) { MethodDoc foundMethod = findOverrideMethod ( iface , method ) ; if ( foundMethod != null ) { return foundMethod ; } } if ( parentClass . superclass ( ) == null ) { return null ; } return findOverrideMethod ( parentClass . superclass ( ) , method ) ; }
Recurse up the inheritance tree for a method that has the override
 annotation to reuse the comment.
Recurse up the inheritance tree for a method that has the override annotation to reuse the comment .
// First check all implementing interfaces for method // Then check super class, if there is one. Otherwise, we missed it. // Restart the search with all interfaces // No super class? Nowhere else to go, so return null. // Nothing found. Restart with super class