for (s = 0; s < nDataPoints; s++) {
// check whether the "valueHistory" array member exists; if not,
// create them:
if (this.valueHistory[s] == null) {
this.valueHistory[s] = new ValueSequence(this.historyCount);
}
this.valueHistory[s].enterData(this.newestAt, newData[s]);
}
for (int s = 0; s < nDataPoints; s++) {
if (this.valueHistory[s] == null) {
this.valueHistory[s] = new ValueSequence(this.historyCount);
}
this.valueHistory[s].enterData(insertionIndex, newData[s]);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/DynamicTimeSeriesCollection.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/time/DynamicTimeSeriesCollection.java
|
Method name: void appendData(float[])
|
|
Method name: void appendData(float[], int, int)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (s = 0; s < nDataPoints; s++) {↵ | | 1 | for (int s = 0; s < nDataPoints; s++) {↵
|
2 | // check whether the "valueHistory" array member exists; if not, ↵ | | 2 | ↵
|
3 | // create them:↵ | | |
|
4 | if (this.valueHistory[s] == null) {↵ | | 3 | if (this.valueHistory[s] == null) {↵
|
5 | this.valueHistory[s] = new ValueSequence(this.historyCount);↵ | | 4 | this.valueHistory[s] = new ValueSequence(this.historyCount);↵
|
6 | }↵ | | 5 | }↵
|
7 | this.valueHistory[s].enterData(this.newestAt, newData[s]);↵ | | 6 | this.valueHistory[s].enterData(insertionIndex, newData[s]);↵
|
8 | } | | 7 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | if (this.valueHistory[s] == null) | | 5 | if (this.valueHistory[s] == null) |
7 | this.valueHistory[s] = new ValueSequence(this.historyCount); | | 6 | this.valueHistory[s] = new ValueSequence(this.historyCount); |
Precondition Violations (0)
Row |
Violation |