File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java | File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/save/OldSaveService.java | |||
Method name: Collection createCollection(Configuration, String)
|
Method name: Map createMap(Configuration, String)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | if (items[i].getName().equals("testelement")) { // $NON-NLS-1$ ↵ | 1 | if (items[i].getName().equals("property")) { // $NON-NLS-1$ ↵ | |
2 | coll.add(new T↵ | 2 | JMeterProperty prop = createProperty(items[i], testClass);↵ | |
3 | if (prop!=null) {↵ | |||
4 | map.put(prop.getName(), prop);↵ | |||
5 | }↵ | |||
3 | estElementProperty↵ | 6 | } else if (items[i].getName().equals("testelement")) { // $NON-NLS-1$ ↵ | |
4 | (items[i].getAttribute("name", ""), createTestElement(items[i]))); // $NON-NLS-1$ // $NON-NLS-2$↵ | 7 | map.put(items[i].getAttribute("name", ""), new TestElementProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$↵ | |
5 | ↵ | 8 | createTestElement(items[i])));↵ | |
6 | } else if (items[i].getName().equals("collection")) { // $NON-NLS-1$ ↵ | 9 | } else if (items[i].getName().equals("collection")) { // $NON-NLS-1$ ↵ | |
7 | coll.add(↵ | 10 | map.put(items[i].getAttribute("name"), // $NON-NLS-1$ ↵ | |
8 | new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$↵ | 11 | new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$↵ | |
9 | createCollection(items[i], testClass)));↵ | 12 | createCollection(items[i], testClass)));↵ | |
10 | } else if (items[i].getName().equals("string")) { // $NON-NLS-1$ ↵ | 13 | } else if (items[i].getName().equals("map")) { // $NON-NLS-1$ ↵ | |
11 | JMeterProperty prop = createProperty(items[i], testClass);↵ | |||
12 | if (prop!=null) {↵ | |||
13 | coll.add(prop);↵ | |||
14 | }↵ | |||
15 | } else if (items[i].getName().equals("map")) { // $NON-NLS-1$ ↵ | |||
16 | coll.add(↵ | 14 | map.put(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$↵ | |
17 | new MapProperty(items[i].getAttribute("name", ""), ↵ | 15 | new MapProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$↵ | |
18 | createMap(items[i], testClass))); // $NON-NLS-1$ // $NON-NLS-2$↵ | 16 | createMap(items[i], testClass)));↵ | |
19 | } | 17 |
| |
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) | 1.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 4.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8 | else if (items[i].getName().equals("testelement")) | 8 | else if (items[i].getName().equals("testelement")) | |||||||||||
| 9 | map.put(items[i].getAttribute("name", ""), new TestElementProperty(items[i].getAttribute("name", ""), createTestElement(items[i]))); | ||||||||||||
9 | coll.add(new TestElementProperty(items[i].getAttribute("name", ""), createTestElement(items[i]))); | | ||||||||||||
10 | else if (items[i].getName().equals("collection")) | 10 | else if (items[i].getName().equals("collection")) | |||||||||||
| 11 | map.put(items[i].getAttribute("name"), new CollectionProperty(items[i].getAttribute("name", ""), createCollection(items[i], testClass))); | ||||||||||||
11 | coll.add(new CollectionProperty(items[i].getAttribute("name", ""), createCollection(items[i], testClass))); | | ||||||||||||
16 | else if (items[i].getName().equals("map")) | 12 | else if (items[i].getName().equals("map")) | |||||||||||
| 13 | map.put(items[i].getAttribute("name", ""), new MapProperty(items[i].getAttribute("name", ""), createMap(items[i], testClass))); | ||||||||||||
17 | coll.add(new MapProperty(items[i].getAttribute("name", ""), createMap(items[i], testClass))); | | ||||||||||||
12 | if (items[i].getName().equals("string")) |
| 4 | if (items[i].getName().equals("property")) | ||||||||||
13 | JMeterProperty prop = createProperty(items[i], testClass); | 5 | JMeterProperty prop = createProperty(items[i], testClass); | |||||||||||
14 | if (prop != null) | 6 | if (prop != null) | |||||||||||
|
| 7 | map.put(prop.getName(), prop); | |||||||||||
15 | coll.add(prop); |
| |
Row | Violation |
---|---|
1 | Unmatched statement map.put(prop.getName(),prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement coll.add(prop); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |