CPD Results

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

Duplications

FileLine
info/magnolia/cms/taglibs/util/ImgTagBeanInfo.java67
info/magnolia/cms/taglibs/util/TableTagBeanInfo.java56
    private String[] properties = new String[]{"header", "class", "style", "id", "cellspacing", "cellpadding"};

    /**
     * @see java.beans.BeanInfo#getPropertyDescriptors()
     */
    public PropertyDescriptor[] getPropertyDescriptors() {

        try {
            List proplist = new ArrayList();
            for (int j = 0; j < properties.length; j++) {
                proplist.add(createPropertyDescriptor(properties[j]));
            }
            PropertyDescriptor[] result = new PropertyDescriptor[proplist.size()];
            return ((PropertyDescriptor[]) proplist.toArray(result));

        }
        catch (IntrospectionException ex) {
            // should never happen
            throw new UnhandledException(ex.getMessage(), ex);
        }

    }

    /**
     * Instantiate a property descriptor for the given property.
     * @param propertyName property name
     * @return property descriptor
     * @throws IntrospectionException if the given property is not valid
     */
    private PropertyDescriptor createPropertyDescriptor(String propertyName) throws IntrospectionException {
        return new PropertyDescriptor(propertyName, TableTag.class, null, "set" + StringUtils.capitalize(propertyName));