File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/tcp/sampler/TCPClientImpl.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/assertions/PackageTest.java | |||
Method name: void write(OutputStream, InputStream)
|
Method name: void testThreadSafety()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | while(is.read(buff)↵ | 1 | synchronized (this) {↵ | |
2 | > 0){↵ | 2 | while (threadsRunning > 0) {↵ | |
3 | os.write(buff);↵ | |||
4 | os.flush();↵ | |||
5 | ↵ | 3 | wait();↵ | |
4 | }↵ | |||
6 | } | 5 | } | |
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 | 7 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | while (is.read(buff) > 0) |
| 9 | while (threadsRunning > 0) | |||||||||||||||||
4 | os.write(buff); |
| | ||||||||||||||||||
5 | os.flush(); |
| 10 | wait(); |
Row | Violation |
---|---|
1 | Unmatched statement os.write(buff); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression os.flush() is a void method call, and thus it cannot be parameterized |
3 | Expression wait() is a void method call, and thus it cannot be parameterized |
4 | Expression os.flush() is a void method call, and thus it cannot be parameterized |
5 | Expression wait() is a void method call, and thus it cannot be parameterized |