CPD Results

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

Duplications

FileLine
org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java238
org/apache/myfaces/custom/datalist/AbstractHtmlDataList.java249
            if (returnValue)
            {
                try
                {
                    callback.invokeContextCallback(context, this);
                    return true;
                }
                catch (Exception e)
                {
                    throw new FacesException(e);
                }
            }
    
            // Now Look throught facets on this UIComponent
            for (Iterator<UIComponent> it = this.getFacets().values().iterator(); !returnValue && it.hasNext();)
            {
                returnValue = it.next().invokeOnComponent(context, clientId, callback);
            }
    
            if (returnValue)
            {
                return returnValue;
            }
            
            // is the component an inner component?
            if (clientId.startsWith(baseClientId))
            {
                // Check if the clientId for the component, which we 
                // are looking for, has a rowIndex attached
                char separator = UINamingContainer.SEPARATOR_CHAR;
                ValueExpression rowKeyVE = getValueExpression("rowKey");
                boolean rowKeyFound = false;
                
                if (rowKeyVE != null)
                {
                    int oldRow = this.getRowIndex();
                    try
                    {
                        // iterate over the rows
                        int rowsToProcess = getRows();
                        // if getRows() returns 0, all rows have to be processed
                        if (rowsToProcess == 0)
                        {
                            rowsToProcess = getRowCount();
                        }
                        int rowIndex = getFirst();
                        for (int rowsProcessed = 0; rowsProcessed < rowsToProcess; rowsProcessed++, rowIndex++)
                        {
                            setRowIndex(rowIndex);
                            if (!isRowAvailable())
                            {
                                break;
                            }
                            
                            if (clientId.startsWith(getContainerClientId(context)))
                            {
                                rowKeyFound = true;
                                break;
                            }
                        }
                        
                        if (rowKeyFound)
                        {
FileLine
org/apache/myfaces/custom/aliasbean/AliasBean.java190
org/apache/myfaces/custom/aliasbean/AliasBeansScope.java121
        makeAliases(context);

        Map facetMap = null;
        for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
        {
            Map.Entry entry = (Map.Entry) it.next();
            if (facetMap == null)
                facetMap = new HashMap();
            UIComponent component = (UIComponent) entry.getValue();
            if (!component.isTransient())
            {
                facetMap.put(entry.getKey(), component.processSaveState(context));
            }
        }

        List childrenList = null;
        if (getChildCount() > 0)
        {
            for (Iterator it = getChildren().iterator(); it.hasNext();)
            {
                UIComponent child = (UIComponent) it.next();
                if (!child.isTransient())
                {
                    if (childrenList == null)
                        childrenList = new ArrayList(getChildCount());
                    childrenList.add(child.processSaveState(context));
                }
            }
        }
FileLine
org/apache/myfaces/custom/calendar/AbstractHtmlInputCalendarTag.java59
org/apache/myfaces/custom/date/AbstractHtmlInputDateTag.java60
            (org.apache.myfaces.custom.date.AbstractHtmlInputDate) component;
        
        if (_dateBusinessConverter != null)
        {
            if (!_dateBusinessConverter.isLiteralText())
            {
                comp.setValueExpression("dateBusinessConverter", _dateBusinessConverter);
            }
            else
            {
                String s = _dateBusinessConverter.getExpressionString();
                if (s != null)
                {            
                    try
                    {
                        Class clazz = ClassUtils.classForName(s);
                        comp.setDateBusinessConverter( (DateBusinessConverter) ClassUtils.newInstance(clazz));
                    }
                    catch(ClassNotFoundException e)
                    {
                        throw new IllegalArgumentException("Class referenced in calendarConverter not found: "+_dateBusinessConverter);
                    }
                    catch(ClassCastException e)
                    {
                        throw new IllegalArgumentException("Class referenced in calendarConverter is not instance of org.apache.myfaces.custom.calendar.CalendarConverter: "+_dateBusinessConverter);
                    }
                }
            }
        }
    }
}