CPD Results

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

Duplications

File Line
info/magnolia/module/samples/setup/UpdateFromFtlToJspConfiguration.java 61
info/magnolia/module/samples/setup/UpdateFromFtlToJspSite.java 61
info/magnolia/module/samples/setup/UpdateFromFtlToJspVirtualUriMapping.java 61
    public UpdateFromFtlToJspConfiguration(String name, String description, String workspaceName, String nodePath) {
        super(name, description);
        this.nodePath = nodePath;
        this.workspaceName = workspaceName;
    }

    @Override
    protected void doExecute(InstallContext installContext) throws RepositoryException, TaskExecutionException {
        try {
            Node currentnode = installContext.getJCRSession(workspaceName).getNode(nodePath);
            handleNode(currentnode);
            //Get all node children. Exclude MetaData
            Iterable<Node> children = NodeUtil.collectAllChildren(currentnode);
            Iterator<Node> childrenIterator = children.iterator();
            while (childrenIterator.hasNext()) {
                handleNode(childrenIterator.next());
            }


        } catch (Exception e) {
            installContext.error("Can't move attributes for node: " + nodePath, e );
        }


    }

    /**
     * Handle node properties to be changed.
     */
    private void handleNode(Node node) throws Exception {
        //Change renderType
        if(node.hasProperty("renderType")) {