CPD Results

The following document contains the results of PMD's CPD 3.7.

Duplications

FileLine
org\apache\struts\taglib\html\LinkTag.java190
org\apache\struts\taglib\logic\RedirectTag.java153
    }

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPage() {
        return (this.page);
    }

    public void setPage(String page) {
        this.page = page;
    }

    public String getAction() {
        return (this.action);
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getModule() {
        return (this.module);
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getParamId() {
        return (this.paramId);
    }

    public void setParamId(String paramId) {
        this.paramId = paramId;
    }

    public String getParamName() {
        return (this.paramName);
    }

    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    public String getParamProperty() {
        return (this.paramProperty);
    }

    public void setParamProperty(String paramProperty) {
        this.paramProperty = paramProperty;
    }

    public String getParamScope() {
        return (this.paramScope);
    }

    public void setParamScope(String paramScope) {
        this.paramScope = paramScope;
    }

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getScope() {
        return (this.scope);
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public boolean getTransaction() {

FileLine
org\apache\struts\taglib\html\ImgTag.java253
org\apache\struts\taglib\html\LinkTag.java206
    }

    public String getAction() {
        return (this.action);
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getModule() {
        return (this.module);
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getParamId() {
        return (this.paramId);
    }

    public void setParamId(String paramId) {
        this.paramId = paramId;
    }

    public String getParamName() {
        return (this.paramName);
    }

    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    public String getParamProperty() {
        return (this.paramProperty);
    }

    public void setParamProperty(String paramProperty) {
        this.paramProperty = paramProperty;
    }

    public String getParamScope() {
        return (this.paramScope);
    }

    public void setParamScope(String paramScope) {
        this.paramScope = paramScope;
    }

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getScope() {
        return (this.scope);
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getTarget() {

FileLine
org\apache\struts\taglib\html\ImgTag.java253
org\apache\struts\taglib\logic\RedirectTag.java169
    }

    public String getAction() {
        return (this.action);
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getModule() {
        return (this.module);
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getParamId() {
        return (this.paramId);
    }

    public void setParamId(String paramId) {
        this.paramId = paramId;
    }

    public String getParamName() {
        return (this.paramName);
    }

    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    public String getParamProperty() {
        return (this.paramProperty);
    }

    public void setParamProperty(String paramProperty) {
        this.paramProperty = paramProperty;
    }

    public String getParamScope() {
        return (this.paramScope);
    }

    public void setParamScope(String paramScope) {
        this.paramScope = paramScope;
    }

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getScope() {
        return (this.scope);
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public boolean getTransaction() {

FileLine
org\apache\struts\taglib\html\OptionsCollectionTag.java308
org\apache\struts\taglib\html\OptionsTag.java317
    protected void addOption(StringBuffer sb, String value, String label,
        boolean matched) {
        sb.append("<option value=\"");

        if (filter) {
            sb.append(TagUtils.getInstance().filter(value));
        } else {
            sb.append(value);
        }

        sb.append("\"");

        if (matched) {
            sb.append(" selected=\"selected\"");
        }

        if (style != null) {
            sb.append(" style=\"");
            sb.append(style);
            sb.append("\"");
        }

        if (styleClass != null) {
            sb.append(" class=\"");
            sb.append(styleClass);
            sb.append("\"");
        }

        sb.append(">");

        if (filter) {
            sb.append(TagUtils.getInstance().filter(label));
        } else {
            sb.append(label);
        }

        sb.append("</option>\r\n");
    }

    /**
     * Return an iterator for the option labels or values, based on our
     * configured properties.
     *
     * @param name     Name of the bean attribute (if any)
     * @param property Name of the bean property (if any)
     * @throws JspException if an error occurs
     */
    protected Iterator getIterator(String name, String property)

FileLine
org\apache\struts\taglib\bean\HeaderTag.java40
org\apache\struts\taglib\bean\ParameterTag.java36
public class ParameterTag extends TagSupport {
    /**
     * The message resources for this package.
     */
    protected static MessageResources messages =
        MessageResources.getMessageResources(
            "org.apache.struts.taglib.bean.LocalStrings");

    // ------------------------------------------------------------- Properties

    /**
     * The name of the scripting variable that will be exposed as a page scope
     * attribute.
     */
    protected String id = null;

    /**
     * Return an array of parameter values if <code>multiple</code> is
     * non-null.
     */
    protected String multiple = null;

    /**
     * The name of the parameter whose value is to be exposed.
     */
    protected String name = null;

    /**
     * The default value to return if no parameter of the specified name is
     * found.
     */
    protected String value = null;

    public String getId() {
        return (this.id);
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMultiple() {
        return (this.multiple);
    }

    public void setMultiple(String multiple) {
        this.multiple = multiple;
    }

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return (this.value);
    }

    public void setValue(String value) {
        this.value = value;
    }

    // --------------------------------------------------------- Public Methods

    /**
     * Retrieve the required property and expose it as a scripting variable.
     *
     * @throws JspException if a JSP exception has occurred
     */
    public int doStartTag() throws JspException {
        // Deal with a single parameter value
        if (multiple == null) {

FileLine
org\apache\struts\taglib\bean\CookieTag.java40
org\apache\struts\taglib\bean\ParameterTag.java36
public class HeaderTag extends TagSupport {
    /**
     * The message resources for this package.
     */
    protected static MessageResources messages =
        MessageResources.getMessageResources(
            "org.apache.struts.taglib.bean.LocalStrings");

    // ------------------------------------------------------------- Properties

    /**
     * The name of the scripting variable that will be exposed as a page scope
     * attribute.
     */
    protected String id = null;

    /**
     * Return an array of header values if <code>multiple</code> is non-null.
     */
    protected String multiple = null;

    /**
     * The name of the header whose value is to be exposed.
     */
    protected String name = null;

    /**
     * The default value to return if no header of the specified name is
     * found.
     */
    protected String value = null;

    public String getId() {
        return (this.id);
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMultiple() {
        return (this.multiple);
    }

    public void setMultiple(String multiple) {
        this.multiple = multiple;
    }

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return (this.value);
    }

    public void setValue(String value) {
        this.value = value;
    }

    // --------------------------------------------------------- Public Methods

    /**
     * Retrieve the required property and expose it as a scripting variable.
     *
     * @throws JspException if a JSP exception has occurred
     */
    public int doStartTag() throws JspException {

FileLine
org\apache\struts\taglib\logic\CompareTagBase.java144
org\apache\struts\taglib\logic\MatchTag.java105
        String variable = null;

        if (cookie != null) {
            Cookie[] cookies =
                ((HttpServletRequest) pageContext.getRequest()).getCookies();

            if (cookies == null) {
                cookies = new Cookie[0];
            }

            for (int i = 0; i < cookies.length; i++) {
                if (cookie.equals(cookies[i].getName())) {
                    variable = cookies[i].getValue();

                    break;
                }
            }
        } else if (header != null) {
            variable =
                ((HttpServletRequest) pageContext.getRequest()).getHeader(header);
        } else if (name != null) {
            Object value =

FileLine
org\apache\struts\taglib\html\OptionsCollectionTag.java355
org\apache\struts\taglib\html\OptionsTag.java406
        if (collection.getClass().isArray()) {
            collection = Arrays.asList((Object[]) collection);
        }

        if (collection instanceof Collection) {
            return (((Collection) collection).iterator());
        } else if (collection instanceof Iterator) {
            return ((Iterator) collection);
        } else if (collection instanceof Map) {
            return (((Map) collection).entrySet().iterator());
        } else if (collection instanceof Enumeration) {
            return new IteratorAdapter((Enumeration) collection);
        } else {
            throw new JspException(messages.getMessage("optionsTag.iterator",

FileLine
org\apache\struts\taglib\html\ErrorsTag.java113
org\apache\struts\taglib\html\MessagesTag.java114
    public String getBundle() {
        return (this.bundle);
    }

    public void setBundle(String bundle) {
        this.bundle = bundle;
    }

    public String getLocale() {
        return (this.locale);
    }

    public void setLocale(String locale) {
        this.locale = locale;
    }

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getHeader() {
        return (this.header);

FileLine
org\apache\struts\taglib\bean\DefineTag.java97
org\apache\struts\taglib\bean\SizeTag.java86
    public String getId() {
        return (this.id);
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return (this.name);
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProperty() {
        return (this.property);
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getScope() {
        return (this.scope);
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    // --------------------------------------------------------- Public Methods

    /**
     * Retrieve the required property and expose it as a scripting variable.
     *
     * @throws JspException if a JSP exception has occurred
     */
    public int doStartTag() throws JspException {

FileLine
org\apache\struts\taglib\nested\logic\NestedNotEmptyTag.java37
org\apache\struts\taglib\nested\logic\NestedPresentTag.java37
public class NestedPresentTag extends PresentTag implements NestedNameSupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\logic\NestedMessagesNotPresentTag.java38
org\apache\struts\taglib\nested\logic\NestedMessagesPresentTag.java38
    implements NestedPropertySupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\html\NestedMultiboxTag.java37
org\apache\struts\taglib\nested\html\NestedPasswordTag.java37
public class NestedNotEmptyTag extends NotEmptyTag implements NestedNameSupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\html\NestedMessagesTag.java38
org\apache\struts\taglib\nested\logic\NestedMessagesNotPresentTag.java38
    implements NestedPropertySupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\html\NestedFileTag.java36
org\apache\struts\taglib\nested\html\NestedPasswordTag.java37
public class NestedMultiboxTag extends MultiboxTag implements NestedNameSupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\html\NestedErrorsTag.java37
org\apache\struts\taglib\nested\html\NestedMessagesTag.java38
    implements NestedPropertySupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\bean\NestedDefineTag.java37
org\apache\struts\taglib\nested\logic\NestedPresentTag.java37
public class NestedFileTag extends FileTag implements NestedNameSupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}

FileLine
org\apache\struts\taglib\nested\bean\NestedDefineTag.java37
org\apache\struts\taglib\nested\logic\NestedMessagesPresentTag.java38
public class NestedErrorsTag extends ErrorsTag implements NestedPropertySupport {
    /* the usual private member variables */
    private String originalName = null;
    private String originalProperty = null;

    /**
     * Overriding method of the heart of the matter. Gets the relative
     * property and leaves the rest up to the original tag implementation.
     * Sweet.
     *
     * @return int JSP continuation directive. This is in the hands of the
     *         super class.
     */
    public int doStartTag() throws JspException {
        // get the original properties
        originalName = getName();
        originalProperty = getProperty();

        // request
        HttpServletRequest request =
            (HttpServletRequest) pageContext.getRequest();

        // set the properties
        NestedPropertyHelper.setNestedProperties(request, this);

        // let the super do it's thing
        return super.doStartTag();
    }

    /**
     * Complete the processing of the tag. The nested tags here will restore
     * all the original value for the tag itself and the nesting context.
     *
     * @return int to describe the next step for the JSP processor
     * @throws JspException for the bad things JSP's do
     */
    public int doEndTag() throws JspException {
        // do the super's ending part
        int i = super.doEndTag();

        // reset the properties
        setName(originalName);
        setProperty(originalProperty);

        // continue
        return i;
    }

    /**
     * Release the tag's resources and reset the values.
     */
    public void release() {
        super.release();

        // reset the originals
        originalName = null;
        originalProperty = null;
    }
}