File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/samplers/HoldSampleSender.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java | |||
Method name: void testEnded()
|
Method name: void closeAllStatements(Collection)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 4 | |||
1 | synchronized (sampleStore) {↵ | |||
2 | Iterator i = sampleStore.iterator();↵ | 1 | Iterator iterator = collection.iterator();↵ | |
3 | while (i.hasNext()) {↵ | 2 | while (iterator.hasNext()) {↵ | |
4 | SampleEvent se = (SampleEvent) i.next();↵ | 3 | PreparedStatement pstmt = (PreparedStatement) iterator.next();↵ | |
5 | listener.sampleOccurred(se);↵ | 4 | ↵ | |
6 | }↵ | |||
7 | ↵ | 5 | close(pstmt);↵ | |
8 | } | 6 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 10 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | Iterator i = sampleStore.iterator(); |
| 1 | Iterator iterator = collection.iterator(); | |||||||||||||||||
5 | while (i.hasNext()) |
| 2 | while (iterator.hasNext()) | |||||||||||||||||
|
| 3 | PreparedStatement pstmt = (PreparedStatement)iterator.next(); | ||||||||||||||||||
| 4 | close(pstmt); | |||||||||||||||||||
6 | SampleEvent se = (SampleEvent)i.next(); |
| | ||||||||||||||||||
7 | listener.sampleOccurred(se); |
| |
Row | Violation |
---|---|
1 | Type java.util.List of variable sampleStore does not match with type java.util.Collection of variable collection |
2 | Unmatched statement PreparedStatement pstmt=(PreparedStatement)iterator.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement SampleEvent se=(SampleEvent)i.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement listener.sampleOccurred(se); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |