src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java [181:210]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (isMethodValid(declaredMethods.get("doPost"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_POST);

        } else if (isMethodValid(declaredMethods.get("doPut"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_PUT);

        } else if (isMethodValid(declaredMethods.get("doDelete"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_DELETE);
        }

        return allowBuf;
    }

    /**
     * Returns <code>true</code> if <code>method</code> is not
     * <code>null</code> and the method is not defined in the class named by
     * <code>className</code>.
     * <p>
     * This method may be used to make sure a method is actually overwritten and
     * not just the default implementation.
     *
     * @param method The Method to check
     * @param className The name of class assumed to contained the initial
     *            declaration of the method.
     * @return <code>true</code> if <code>method</code> is not
     *         <code>null</code> and the methods declaring class is not the
     *         given class.
     */
    protected boolean isMethodValid(Method method, String className) {
        return method != null && !method.getClass().getName().equals(className);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/sling/api/servlets/SlingJakartaAllMethodsServlet.java [183:212]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (isMethodValid(declaredMethods.get("doPost"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_POST);

        } else if (isMethodValid(declaredMethods.get("doPut"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_PUT);

        } else if (isMethodValid(declaredMethods.get("doDelete"), className)) {
            allowBuf.append(", ").append(HttpConstants.METHOD_DELETE);
        }

        return allowBuf;
    }

    /**
     * Returns <code>true</code> if <code>method</code> is not
     * <code>null</code> and the method is not defined in the class named by
     * <code>className</code>.
     * <p>
     * This method may be used to make sure a method is actually overwritten and
     * not just the default implementation.
     *
     * @param method The Method to check
     * @param className The name of class assumed to contained the initial
     *            declaration of the method.
     * @return <code>true</code> if <code>method</code> is not
     *         <code>null</code> and the methods declaring class is not the
     *         given class.
     */
    protected boolean isMethodValid(Method method, String className) {
        return method != null && !method.getClass().getName().equals(className);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



