File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/control/TestHTTPMirrorThread.java | File path: /jakarta-jmeter-2.3.2/test/src/org/apache/jmeter/protocol/http/sampler/TestHTTPSamplersAgainstHttpMirrorServer.java | |||
Method name: void checkArraysHaveSameContent(byte[], byte[])
|
Method name: void checkArraysHaveSameContent(byte[], byte[])
|
|||
Number of AST nodes: 17 | Number of AST nodes: 17 | |||
1 | if(expected != null && actual != null) {↵ | 1 | if(expected != null && actual != null) {↵ | |
2 | if(expected.length != actual.length) {↵ | 2 | if(expected.length != actual.length) {↵ | |
3 | System.out.println(">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length);↵ | 3 | System.out.println(">>>>>>>>>>>>>>>>>>>>");↵ | |
4 | System.out.println(new String(expected,"UTF-8"));↵ | 4 | System.out.println(new String(expected,"UTF-8"));↵ | |
5 | System.out.println("==================== (actual) : length " + actual.length);↵ | 5 | System.out.println("====================");↵ | |
6 | System.out.println(new String(actual,"UTF-8"));↵ | 6 | System.out.println(new String(actual,"UTF-8"));↵ | |
7 | System.out.println("<<<<<<<<<<<<<<<<<<<<");↵ | 7 | System.out.println("<<<<<<<<<<<<<<<<<<<<");↵ | |
8 | fail("arrays have different length, expected is " + expected.length + ", actual is " + actual.length);↵ | 8 | fail("arrays have different length, expected is " + expected.length + ", actual is " + actual.length);↵ | |
9 | }↵ | 9 | }↵ | |
10 | else {↵ | 10 | else {↵ | |
11 | for(int i = 0; i < expected.length; i++) {↵ | 11 | for(int i = 0; i < expected.length; i++) {↵ | |
12 | if(expected[i] != actual[i]) {↵ | 12 | if(expected[i] != actual[i]) {↵ | |
13 | System.out.println(">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length);↵ | 13 | System.out.println(">>>>>>>>>>>>>>>>>>>>");↵ | |
14 | System.out.println(new String(expected,0,i+1));↵ | 14 | System.out.println(new String(expected,0,i+1));↵ | |
15 | System.out.println("==================== (actual) : length " + actual.length);↵ | 15 | System.out.println("====================");↵ | |
16 | System.out.println(new String(actual,0,i+1));↵ | 16 | System.out.println(new String(actual,0,i+1));↵ | |
17 | System.out.println("<<<<<<<<<<<<<<<<<<<<");↵ | 17 | System.out.println("<<<<<<<<<<<<<<<<<<<<");↵ | |
18 | /*↵ | 18 | /*↵ | |
19 | ↵ | |||
19 | // Useful to when debugging↵ | 20 | // Useful to when debugging↵ | |
20 | for(int j = 0; j < expected.length; j++) {↵ | 21 | for(int j = 0; j < expected.length; j++) {↵ | |
21 | System.out.print(expected[j] + " ");↵ | 22 | System.out.print(expected[j] + " ");↵ | |
22 | }↵ | 23 | }↵ | |
23 | System.out.println();↵ | 24 | System.out.println();↵ | |
24 | for(int j = 0; j < actual.length; j++) {↵ | 25 | for(int j = 0; j < actual.length; j++) {↵ | |
25 | System.out.print(actual[j] + " ");↵ | 26 | System.out.print(actual[j] + " ");↵ | |
26 | }↵ | 27 | }↵ | |
27 | System.out.println();↵ | 28 | System.out.println();↵ | |
28 | */ ↵ | 29 | */ ↵ | |
29 | fail("byte at position " + i + " is different, expected is " + expected[i] + ", actual is " + actual[i]);↵ | 30 | fail("byte at position " + i + " is different, expected is " + expected[i] + ", actual is " + actual[i]);↵ | |
30 | }↵ | 31 | }↵ | |
31 | }↵ | 32 | }↵ | |
32 | }↵ | 33 | }↵ | |
33 | }↵ | 34 | }↵ | |
34 | else {↵ | 35 | else {↵ | |
35 | fail("expected or actual byte arrays were null");↵ | 36 | fail("expected or actual byte arrays were null");↵ | |
36 | } | 37 |
| |
See real code fragment | See real code fragment |
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.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 103 |
Number of mapped statements | 17 |
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) | 21.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (expected != null && actual != null) | 1 | if (expected != null && actual != null) | ||||||||||||
2 | if (expected.length != actual.length) | 2 | if (expected.length != actual.length) | ||||||||||||
3 | System.out.println(">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length); |
| 3 | System.out.println(">>>>>>>>>>>>>>>>>>>>"); | |||||||||||
4 | System.out.println(new String(expected, "UTF-8")); | 4 | System.out.println(new String(expected, "UTF-8")); | ||||||||||||
5 | System.out.println("==================== (actual) : length " + actual.length); |
| 5 | System.out.println("===================="); | |||||||||||
6 | System.out.println(new String(actual, "UTF-8")); | 6 | System.out.println(new String(actual, "UTF-8")); | ||||||||||||
7 | System.out.println("<<<<<<<<<<<<<<<<<<<<"); | 7 | System.out.println("<<<<<<<<<<<<<<<<<<<<"); | ||||||||||||
8 | fail("arrays have different length, expected is " + expected.length + ", actual is " + actual.length); | 8 | fail("arrays have different length, expected is " + expected.length + ", actual is " + actual.length); | ||||||||||||
else | else | ||||||||||||||
9 | for (int i = 0; i < expected.length; i++) | 9 | for (int i = 0; i < expected.length; i++) | ||||||||||||
10 | if (expected[i] != actual[i]) | 10 | if (expected[i] != actual[i]) | ||||||||||||
11 | System.out.println(">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length); |
| 11 | System.out.println(">>>>>>>>>>>>>>>>>>>>"); | |||||||||||
12 | System.out.println(new String(expected, 0, i + 1)); | 12 | System.out.println(new String(expected, 0, i + 1)); | ||||||||||||
13 | System.out.println("==================== (actual) : length " + actual.length); |
| 13 | System.out.println("===================="); | |||||||||||
14 | System.out.println(new String(actual, 0, i + 1)); | 14 | System.out.println(new String(actual, 0, i + 1)); | ||||||||||||
15 | System.out.println("<<<<<<<<<<<<<<<<<<<<"); | 15 | System.out.println("<<<<<<<<<<<<<<<<<<<<"); | ||||||||||||
16 | fail("byte at position " + i + " is different, expected is " + expected[i] + ", actual is " + actual[i]); | 16 | fail("byte at position " + i + " is different, expected is " + expected[i] + ", actual is " + actual[i]); | ||||||||||||
else | else | ||||||||||||||
17 | fail("expected or actual byte arrays were null"); | 17 | fail("expected or actual byte arrays were null"); |
Row | Violation |
---|---|
1 | Expression ">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression "==================== (actual) : length " + actual.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression ">>>>>>>>>>>>>>>>>>>> (expected) : length " + expected.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression "==================== (actual) : length " + actual.length cannot be parameterized, because it has dependencies to/from statements that will be extracted |