magnolia-core Version: 4.4.6 Last Published: Jan 17, 2012

CPD Results

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

Duplications

FileLine
info/magnolia/cms/link/UUIDLink.java252
info/magnolia/link/Link.java122
        return this.node;
    }


    public void setNode(Content node) {
        this.node = node;
    }

    public NodeData getNodeData() {
        if(this.nodeData == null && StringUtils.isNotEmpty(this.nodeDataName) && this.getNode() != null){
            this.nodeData = this.getNode().getNodeData(this.nodeDataName);
        }
        return this.nodeData;
    }

    public void setNodeData(NodeData nodeData) {
        this.nodeData = nodeData;
    }

    public String getNodeDataName() {
        return this.nodeDataName;
    }

    public void setNodeDataName(String nodeDataName) {
        this.nodeDataName = nodeDataName;
    }

    public String getHandle() {
        if(StringUtils.isEmpty(this.handle)){
            if(getNode() != null){
                handle = getNode().getHandle();
            } else {
                handle = this.getFallbackHandle();
            }
        }
        return this.handle;
    }

    public void setHandle(String path) {
        this.handle = path;
    }

    public String getRepository() {
        return this.repository;
    }

    public void setRepository(String repository) {
        this.repository = repository;
    }

    public String getUUID() {
        if(StringUtils.isEmpty(this.uuid) && this.getNode() != null){
            this.uuid = this.getNode().getUUID();
        }
        return this.uuid;
    }

    public void setUUID(String uuid) {
        this.uuid = uuid;
    }

    public String getFallbackHandle() {
        return this.fallbackHandle;
    }

    public void setFallbackHandle(String fallbackPath) {
        this.fallbackHandle = fallbackPath;
    }

    public String getAnchor() {
        return this.anchor;
    }

    public void setAnchor(String anchor) {
        this.anchor = anchor;
    }

    public String getParameters() {
        return this.parameters;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }
}
FileLine
info/magnolia/cms/core/MetaData.java389
info/magnolia/cms/core/MetaData.java415
    public void setProperty(String name, boolean value) throws AccessDeniedException {
        allowUpdate();
        name = this.getInternalPropertyName(name);
        try {
            this.node.getProperty(name).setValue(value);
        }
        catch (PathNotFoundException e) {
            try {
                this.node.setProperty(name, value);
            }
            catch (RepositoryException re) {
                log.error(re.getMessage(), re);
            }
        }
        catch (RepositoryException re) {
            log.error(re.getMessage(), re);
            throw new AccessDeniedException(re.getMessage());
        }
        catch (NullPointerException e) {
            if (log.isDebugEnabled()) {
                log.debug("MetaData has not been created or this node does not support MetaData"); //$NON-NLS-1$
                log.debug("cannot set property - " + name); //$NON-NLS-1$
            }
        }
    }

    public void setProperty(String name, Calendar value) throws AccessDeniedException {
FileLine
info/magnolia/context/AbstractMapBasedContext.java59
info/magnolia/context/MapAttributeStrategy.java48
    }

    public void setAttribute(String name, Object value, int scope) {
        this.map.put(name, value);
    }

    public Object getAttribute(String name, int scope) {
        return this.map.get(name);
    }

    public void removeAttribute(String name, int scope) {
        this.map.remove(name);
    }

    /**
     * Ignore scope and return the inner map.
     */
    public Map<String, Object> getAttributes(int scope) {
        return this.getAttributes();
    }

    /**
     * Returns the inner map.
     */
    public Map<String, Object> getAttributes() {
        return this.map;
    }


    public Map<String, Object> getMap() {
        return map;
    }


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

}
FileLine
info/magnolia/cms/link/AbsolutePathTransformer.java112
info/magnolia/link/AbsolutePathTransformer.java102
    public String getURISuffix(Link uuidLink) {
        String anchor = uuidLink.getAnchor();
        String parameters = uuidLink.getParameters();

        return "" + (StringUtils.isNotEmpty(anchor)? "#" + anchor : "") +
        (StringUtils.isNotEmpty(parameters)? "?" + parameters : "");

    }

    public boolean isAddContextPath() {
        return this.addContextPath;
    }


    public void setAddContextPath(boolean addContextPath) {
        this.addContextPath = addContextPath;
    }


    public boolean isUseI18N() {
        return this.useI18N;
    }


    public void setUseI18N(boolean useI18N) {
        this.useI18N = useI18N;
    }


    public boolean isUseURI2RepositoryMapping() {
        return this.useURI2RepositoryMapping;
    }


    public void setUseURI2RepositoryMapping(boolean useURI2RepositoryMapping) {
        this.useURI2RepositoryMapping = useURI2RepositoryMapping;
    }

}
FileLine
info/magnolia/cms/link/UUIDLink.java165
info/magnolia/link/LinkFactory.java130
            if (exists) {
                node = hm.getContent(path);
            }
            if (node == null) {
                // this is a binary containing the name at the end
                // this name is stored as an attribute but is not part of the handle
                if (hm.isNodeData(StringUtils.substringBeforeLast(path, "/"))) {
                    fileName = StringUtils.substringAfterLast(path, "/");
                    path = StringUtils.substringBeforeLast(path, "/");
                }

                // link to the binary node data
                if (hm.isNodeData(path)) {
                    nodeDataName = StringUtils.substringAfterLast(path, "/");
                    path = StringUtils.substringBeforeLast(path, "/");
                    node = hm.getContent(path);
                    nodeData = node.getNodeData(nodeDataName);
                }
            }
            if (node == null) {
FileLine
info/magnolia/cms/core/MetaData.java389
info/magnolia/cms/core/MetaData.java467
    public void setProperty(String name, Calendar value) throws AccessDeniedException {
        allowUpdate();
        name = this.getInternalPropertyName(name);
        try {
            this.node.getProperty(name).setValue(value);
        }
        catch (PathNotFoundException e) {
            try {
                this.node.setProperty(name, value);
            }
            catch (RepositoryException re) {
                log.error(re.getMessage(), re);
            }
        }
        catch (RepositoryException re) {
            log.error(re.getMessage(), re);
            throw new AccessDeniedException(re.getMessage());
        }
        catch (NullPointerException e) {
FileLine
info/magnolia/setup/for3_6_2/UpdateGroups.java76
info/magnolia/setup/for3_6_2/UpdateRoles.java76
                role.save();
            }
            Iterator iter2 = acls.getChildren().iterator();
            while (iter2.hasNext()) {
                Content permission = (Content)iter2.next();
                if (handle.equals(permission.getNodeData("path").getString()) && (permission.getNodeData("permissions").getLong() >= Permission.READ)) {
                    hasAccess = true;
                    break;
                }
            }
            if (!hasAccess) {
                Content acl = acls.createContent(Path.getUniqueLabel(installContext.getHierarchyManager(ContentRepository.USER_ROLES), acls.getHandle(), "0"), ItemType.CONTENTNODE);