private Collection<DuplicateCode> convert(final List<Duplication> duplications, final String moduleName) {
        List<DuplicateCode> annotations = new ArrayList<DuplicateCode>();

        for (Duplication duplication : duplications) {
            List<DuplicateCode> codeBlocks = new ArrayList<DuplicateCode>();
            boolean isDerived = false;
            for (SourceFile file : duplication.getFiles()) {
                // TODO: check why PMD reports a length + 1
                DuplicateCode annotation = new DuplicateCode(getPriority(duplication.getLines()), file.getLine(), duplication.getLines(), file.getPath(), isDerived);
                annotation.setSourceCode(duplication.getCodeFragment());
                annotation.setModuleName(moduleName);
                codeBlocks.add(annotation);
                isDerived = true;
            }
            for (DuplicateCode block : codeBlocks) {
                block.linkTo(codeBlocks);

                block.setPackageName(PackageDetectors.detectPackageName(block.getFileName()));
            }
            annotations.addAll(codeBlocks);
        }
        return annotations;
    }
private Collection<DuplicateCode> convert(final List<Duplication> duplications, final String moduleName) {
        List<DuplicateCode> annotations = new ArrayList<DuplicateCode>();

        for (Duplication duplication : duplications) {
            List<DuplicateCode> codeBlocks = new ArrayList<DuplicateCode>();
            boolean isDerived = false;
            for (SourceFile file : duplication.getFiles()) {
                
                DuplicateCode annotation = new DuplicateCode(getPriority(duplication.getLines()), file.getLine(), duplication.getLines(), file.getPath(), isDerived);
                annotation.setSourceCode(duplication.getCodeFragment());
                annotation.setModuleName(moduleName);
                codeBlocks.add(annotation);
                isDerived = true;
            }
            for (DuplicateCode block : codeBlocks) {
                block.linkTo(codeBlocks);

                block.setPackageName(PackageDetectors.detectPackageName(block.getFileName()));
            }
            annotations.addAll(codeBlocks);
        }
        return annotations;
    }
private Collection < DuplicateCode > convert ( final List < Duplication > duplications , final String moduleName ) { List < DuplicateCode > annotations = new ArrayList < DuplicateCode > ( ) ; for ( Duplication duplication : duplications ) { List < DuplicateCode > codeBlocks = new ArrayList < DuplicateCode > ( ) ; boolean isDerived = false ; for ( SourceFile file : duplication . getFiles ( ) ) { // TODO: check why PMD reports a length + 1 DuplicateCode annotation = new DuplicateCode ( getPriority ( duplication . getLines ( ) ) , file . getLine ( ) , duplication . getLines ( ) , file . getPath ( ) , isDerived ) ; annotation . setSourceCode ( duplication . getCodeFragment ( ) ) ; annotation . setModuleName ( moduleName ) ; codeBlocks . add ( annotation ) ; isDerived = true ; } for ( DuplicateCode block : codeBlocks ) { block . linkTo ( codeBlocks ) ; block . setPackageName ( PackageDetectors . detectPackageName ( block . getFileName ( ) ) ) ; } annotations . addAll ( codeBlocks ) ; } return annotations ; }
Converts the internal structure to the annotations API.

@param duplications
the internal maven module
@param moduleName
name of the maven module
@return a maven module of the annotations API
Converts the internal structure to the annotations API .