this.structureHighlightColor = structureHighlightColor;
StructureMatcher.Match match = textArea.getStructureMatch();
if(match != null)
{
textArea.invalidateLineRange(
match.startLine,match.endLine
);
}
this.structureHighlight = structureHighlight;
StructureMatcher.Match match = textArea.getStructureMatch();
if(match != null)
{
textArea.invalidateLineRange(
match.startLine,
match.endLine
);
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/TextAreaPainter.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/textarea/TextAreaPainter.java
|
Method name: void setStructureHighlightColor(Color)
|
|
Method name: void setStructureHighlightEnabled(boolean)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | this.structureHighlightColor = structureHighlightColor;↵ | | 1 | this.structureHighlight = structureHighlight;↵
|
2 | StructureMatcher.Match match = textArea.getStructureMatch();↵ | | 2 | StructureMatcher.Match match = textArea.getStructureMatch();↵
|
3 | if(match != null)↵ | | 3 | if(match != null)↵
|
4 | {↵ | | 4 | {↵
|
5 | textArea.invalidateLineRange(↵ | | 5 | textArea.invalidateLineRange(↵
|
6 | match.startLine,↵ | | 6 | match.startLine,↵
|
7 | match.endLine↵ | | 7 | match.endLine↵
|
8 | );↵ | | 8 | );↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | this.structureHighlight = structureHighlight; |
1 | this.structureHighlightColor = structureHighlightColor; | | | |
2 | StructureMatcher.Match match = textArea.getStructureMatch(); | | 2 | StructureMatcher.Match match = textArea.getStructureMatch(); |
3 | if (match != null) | | 3 | if (match != null) |
4 | textArea.invalidateLineRange(match.startLine, match.endLine); | | 4 | textArea.invalidateLineRange(match.startLine, match.endLine); |
Precondition Violations (0)
Row |
Violation |