magnolia-templating Version: 4.5-beta1 Last Published: Nov 8, 2011

CPD Results

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

Duplications

FileLine
info/magnolia/templating/elements/AreaElement.java394
info/magnolia/templating/elements/RenderElement.java101
    }


    public Map<String, Object> getContextAttributes() {
        return contextAttributes;
    }

    public void setContextAttributes(Map<String, Object> contextAttributes) {
        this.contextAttributes = contextAttributes;
    }

    private void setContextAttributes(WebContext webContext, Map<String, Object> ctx) {
        if(ctx != null){
            for(Entry<String, Object> entry : ctx.entrySet()) {
                final String key = entry.getKey();
                if(webContext.containsKey(key)) {
                    //save to tmp map
                    savedCtxAttributes.put(key, webContext.get(key));
                }
                webContext.setAttribute(key, entry.getValue(), WebContext.LOCAL_SCOPE);
            }

        }
    }

    private void restoreContextAttributes(WebContext webContext, Map<String, Object> ctx) {
        if(ctx != null) {
            for(Entry<String, Object> entry : ctx.entrySet()) {
                final String key = entry.getKey();
                if(webContext.containsKey(key)) {
                    webContext.setAttribute(key, savedCtxAttributes.get(key), WebContext.LOCAL_SCOPE);
                }
                webContext.removeAttribute(key, WebContext.LOCAL_SCOPE);
            }
        }
    }