synchronized (tableRows) {
row = (SamplingStatCalculator) tableRows.get(sampleLabel);
if (row == null) {
row = new SamplingStatCalculator(sampleLabel);
tableRows.put(row.getLabel(), row);
model.insertRow(row, model.getRowCount() - 1);
}
}
synchronized (tableRows) {
row = (SamplingStatCalculator) tableRows.get(sampleLabel);
if (row == null) {
row = new SamplingStatCalculator(sampleLabel);
tableRows.put(row.getLabel(), row);
model.insertRow(row, model.getRowCount() - 1);
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/StatGraphVisualizer.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/StatVisualizer.java
|
Method name: void add(SampleResult)
|
|
Method name: void add(SampleResult)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | synchronized (tableRows) {↵ | | 1 | synchronized (tableRows) {↵
|
2 | row = (SamplingStatCalculator) tableRows.get(sampleLabel);↵ | | 2 | row = (SamplingStatCalculator) tableRows.get(sampleLabel);↵
|
3 | if (row == null) {↵ | | 3 | if (row == null) {↵
|
4 | row = new SamplingStatCalculator(sampleLabel);↵ | | 4 | row = new SamplingStatCalculator(sampleLabel);↵
|
5 | tableRows.put(row.getLabel(), row);↵ | | 5 | tableRows.put(row.getLabel(), row);↵
|
6 | model.insertRow(row, model.getRowCount() - 1);↵ | | 6 | model.insertRow(row, model.getRowCount() - 1);↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 8 | }
|
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 in different classes having the same super class |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.5 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | synchronized (tableRows) | | 3 | synchronized (tableRows) |
4 | row = (SamplingStatCalculator)tableRows.get(sampleLabel); | | 4 | row = (SamplingStatCalculator)tableRows.get(sampleLabel); |
5 | | | 5 | |
6 | row = new SamplingStatCalculator(sampleLabel); | | 6 | row = new SamplingStatCalculator(sampleLabel); |
7 | tableRows.put(row.getLabel(), row); | | 7 | tableRows.put(row.getLabel(), row); |
8 | model.insertRow(row, model.getRowCount() - 1); | | 8 | model.insertRow(row, model.getRowCount() - 1); |
Precondition Violations (0)
Row |
Violation |