CPD Results

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

Duplications

FileLine
info/magnolia/module/samples/setup/UpdateFromFtlToJspConfiguration.java61
info/magnolia/module/samples/setup/UpdateFromFtlToJspVirtualUriMapping.java61
    public UpdateFromFtlToJspVirtualUriMapping(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 fromURI
        if(node.hasProperty("fromURI")) {