@Beta public interface DuplicationBuilder
DuplicationBuilder builder = context.duplicationBuilder(inputFile);
.originBlock(2, 10)
.isDuplicatedBy(inputFile, 14, 22)
.isDuplicatedBy(anotherInputFile, 3, 11)
// Start another duplication
.originBlock(45, 50)
.isDuplicatedBy(yetAnotherInputFile, 10, 15);
context.saveDuplications(inputFile, builder.build());
Modifier and Type | Method and Description |
---|---|
List<DuplicationGroup> |
build()
Call this method when you have declared all duplications of the file.
|
DuplicationBuilder |
isDuplicatedBy(InputFile sameOrOtherFile,
int startLine,
int endLine)
Declare duplicate block of the previously declared
originBlock(int, int) . |
DuplicationBuilder |
originBlock(int startLine,
int endLine)
Declare duplication origin block.
|
DuplicationBuilder originBlock(int startLine, int endLine)
isDuplicatedBy(InputFile, int, int)
to reference all duplicates of this block.
Then call again originBlock(int, int)
to declare another duplication.DuplicationBuilder isDuplicatedBy(InputFile sameOrOtherFile, int startLine, int endLine)
originBlock(int, int)
.sameOrOtherFile
- duplicate can be in the same file or in another file.List<DuplicationGroup> build()
Copyright © 2009–2015 SonarSource. All rights reserved.