Foundation

CPD Results

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

Duplications

FileLine
org/apache/myfaces/custom/suggestajax/inputsuggestajax/InputSuggestAjaxTagHandler.java47
org/apache/myfaces/custom/suggestajax/tablesuggestajax/TableSuggestAjaxTagHandler.java41
    public TableSuggestAjaxTagHandler(ComponentConfig config)
    {
        super(config);
        suggestedItemsMethodAttr = getAttribute(SUGGESTED_ITEMS_METHOD);
        maxSuggestedItemsAttr = getAttribute(MAX_SUGGESTED_ITEMS);
    }
    
    protected void setAttributes(FaceletContext ctx, Object instance)
    {
        super.setAttributes(ctx, instance);

        Application app = ctx.getFacesContext().getApplication();
        
        SuggestAjax comp = (SuggestAjax) instance;
        
        if (maxSuggestedItemsAttr != null){
            String maxSuggestedItems = maxSuggestedItemsAttr.getValue();
            
            if (maxSuggestedItems != null)
            {
                if (UIComponentTag.isValueReference(maxSuggestedItems))
                {
                    ValueBinding vb = app.createValueBinding(maxSuggestedItems);
                    comp.setValueBinding(MAX_SUGGESTED_ITEMS, vb);
                }
                else
                {
                    comp.getAttributes().put(MAX_SUGGESTED_ITEMS, Integer.valueOf(maxSuggestedItems));
                }
            } 
        }
        
        if (suggestedItemsMethodAttr != null){
            String suggestedItemsMethod = suggestedItemsMethodAttr.getValue();
            if (suggestedItemsMethod != null)
            {
                AbstractSuggestAjaxTag.setSuggestedItemsMethodProperty(ctx.getFacesContext(),
                        comp,suggestedItemsMethod);
            }
        }
    }
FileLine
org/apache/myfaces/custom/dojolayouts/FloatingPaneBaseRenderer.java46
org/apache/myfaces/custom/dojolayouts/TitlePaneRenderer.java41
public class TitlePaneRenderer extends DojoContentPaneRenderer {

    public void decode(FacesContext context, UIComponent component) {
        super.decode(context, component);

    }

    protected void encodeJavascriptBegin(FacesContext context, UIComponent component) throws IOException {
        String javascriptLocation = (String) component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
        try {
            if (javascriptLocation != null) {
                DojoUtils.addMainInclude(context, component, javascriptLocation, new DojoConfig());
            } else {
                DojoUtils.addMainInclude(context, component, null, new DojoConfig());
            }
        }

        catch (IOException e) {
            e.printStackTrace();
        }
        String [] requires = {"dojo.widget.myfaces.SavestatingTitlePane",
FileLine
org/apache/myfaces/custom/dojolayouts/DojoContentPaneRenderer.java69
org/apache/myfaces/custom/dojolayouts/FloatingPaneBaseRenderer.java72
        return ((FloatingPaneBase) component).getResizable() != null && ((FloatingPaneBase) component).getResizable().booleanValue();
    }

    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        
            if ((context == null) || (component == null)) {
                throw new NullPointerException();
            }

            Boolean rendered = (Boolean) component.getAttributes().get("rendered");

            if ((rendered != null) && (!rendered.booleanValue()))
                return;
            encodeJavascriptBegin(context, component);

            super.encodeBegin(context, component);

            ResponseWriter writer = context.getResponseWriter();
            writer.startElement(HTML.DIV_ELEM, component);
            HtmlRendererUtils.writeIdIfNecessary(writer, component, context);
FileLine
org/apache/myfaces/custom/dojolayouts/DojoContentPaneRenderer.java49
org/apache/myfaces/custom/dojolayouts/FloatingPaneBaseRenderer.java46
public class FloatingPaneBaseRenderer extends HtmlRenderer {

    public void decode(FacesContext context, UIComponent component) {
        super.decode(context, component);

    }

    protected void encodeJavascriptBegin(FacesContext context, UIComponent component) throws IOException {
        String javascriptLocation = (String) component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
        try {
            if (javascriptLocation != null) {
                DojoUtils.addMainInclude(context, component, javascriptLocation, new DojoConfig());
            } else {
                DojoUtils.addMainInclude(context, component, null, new DojoConfig());
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
FileLine
org/apache/myfaces/custom/graphicimagedynamic/util/ImageResponseStream.java34
org/apache/myfaces/custom/outputlinkdynamic/OutputLinkDynamicRenderer.java75
        private ResourceResponseStream(OutputStream out)
        {
            _out = out;
        }

        public void close() throws IOException
        {
            _out.flush();
            _out.close();
        }

        public void flush() throws IOException
        {
            _out.flush();
        }

        public void write(byte[] b, int off, int len) throws IOException
        {
            _out.write(b, off, len);
        }

        public void write(byte[] b) throws IOException
        {
            _out.write(b);
        }

        public void write(int b) throws IOException
        {
            _out.write(b);
        }
    }
FileLine
org/apache/myfaces/custom/dojolayouts/DojoContentPaneRenderer.java49
org/apache/myfaces/custom/dojolayouts/TitlePaneRenderer.java41
public class TitlePaneRenderer extends DojoContentPaneRenderer {

    public void decode(FacesContext context, UIComponent component) {
        super.decode(context, component);

    }

    protected void encodeJavascriptBegin(FacesContext context, UIComponent component) throws IOException {
        String javascriptLocation = (String) component.getAttributes().get(JSFAttr.JAVASCRIPT_LOCATION);
        try {
            if (javascriptLocation != null) {
                DojoUtils.addMainInclude(context, component, javascriptLocation, new DojoConfig());
            } else {
                DojoUtils.addMainInclude(context, component, null, new DojoConfig());
            }
        }

        catch (IOException e) {
            e.printStackTrace();
        }