CPD Results

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

Duplications

File Line
net/sourceforge/jenesis4java/impl/MStatement.java 643
net/sourceforge/jenesis4java/impl/MStatement.java 774
            out.queue(comment);

            if (isFinal) {
                out.write("final").space();
            }

            out.write(type).space();

            for (int i = 0; i < v.size(); i++) {
                if (i > 0) {
                    out.write(',').space();
                }
                out.write(v.get(i));
            }
File Line
net/sourceforge/jenesis4java/impl/MDeclaration.java 691
net/sourceforge/jenesis4java/jaloppy/JenesisJalopyEncoder.java 273
            String topLevelTypeName = getTopLevelType().getName();
            int indexOfGeneric = topLevelTypeName.indexOf('<');
            if (indexOfGeneric > 0) {
                topLevelTypeName = topLevelTypeName.substring(0, indexOfGeneric).trim();
            }
            file.append(java.io.File.separatorChar).append(topLevelTypeName).append(".java");

            // done
            return file.toString();
        }
File Line
net/sourceforge/jenesis4java/impl/MExpression.java 971
net/sourceforge/jenesis4java/impl/MExpression.java 1108
            out.write("new ").write(type).write('(');

            for (int i = 0; i < ve.size(); i++) {
                if (i > 0) {
                    out.write(", ");
                }
                out.write(ve.get(i));
            }
            out.write(')');
File Line
net/sourceforge/jenesis4java/impl/MDeclaration.java 1093
net/sourceforge/jenesis4java/impl/MDeclaration.java 1118
        MInnerClass(MVM vm, MCompilationUnit unit, MClassDeclaration parent, String name) {
            super(vm, unit);
            this.parent = parent;
            this.name = name;
        }

        @Override
        public ClassDeclaration getParentClass() {
            return parent;
        }

        @Override
        public void visit(ReplacingVisitor visitor) {
            super.visit(visitor);
            // skip parent that would be an endless loop
        }
    }

    /**
     * INNER CLASS DECLARATION
     */
    static class MInnerInterface extends MInterface implements InnerInterface {
File Line
net/sourceforge/jenesis4java/impl/MExpression.java 863
net/sourceforge/jenesis4java/impl/MExpression.java 1108
            out.write('(');
            for (int i = 0; i < ve.size(); i++) {
                if (i > 0) {
                    out.write(", ");
                }
                out.write(ve.get(i));
            }
            out.write(')');

            return out;
        }

        @Override
        public boolean isActive(Style style) {
File Line
net/sourceforge/jenesis4java/impl/MDeclaration.java 105
net/sourceforge/jenesis4java/impl/MStatement.java 104
        public Let newDeclarationLet(Type type) {
            Let x = new MStatement.MLet(vm, type);
            int index = 0;
            while (index < vs.size() && vs.get(index) instanceof Let) {
                index++;
            }
            vs.add(index, x);
            return x;
        }
File Line
net/sourceforge/jenesis4java/impl/MDeclaration.java 925
net/sourceforge/jenesis4java/impl/MDeclaration.java 1356
            return this;
        }

        @Override
        public CodeWriter toCode(CodeWriter out) {
            // special treatment for class fields
            // always ensure exactly one line is emptyfree at the top

            out.ensureNewLine().newLine();

            if (comment != null && comment.getType() != Comment.TRAILING) {
                out.write(comment);
            }

            if (!annotations.isEmpty()) {
File Line
net/sourceforge/jenesis4java/impl/MExpression.java 863
net/sourceforge/jenesis4java/impl/MExpression.java 971
            out.write('(');
            for (int i = 0; i < ve.size(); i++) {
                if (i > 0) {
                    out.write(", ");
                }
                out.write(ve.get(i));
            }
            out.write(')');