if (items[i].getName().equals("collection")) { // $NON-NLS-1$ coll.add(new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$ createCollection(items[i], testClass))); } else if (items[i].getName().equals("string")) { // $NON-NLS-1$ JMeterProperty prop = createProperty(items[i], testClass); if (prop!=null) { coll.add(prop); } } else if (items[i].getName().equals("map")) { // $NON-NLS-1$ coll.add(new MapProperty(items[i].getAttribute("name", ""), createMap(items[i], testClass))); // $NON-NLS-1$ // $NON-NLS-2$ }
if (items[i].getName().equals("testelement")) { // $NON-NLS-1$ map.put(items[i].getAttribute("name", ""), new TestElementProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$ createTestElement(items[i]))); } else if (items[i].getName().equals("collection")) { // $NON-NLS-1$ map.put(items[i].getAttribute("name"), // $NON-NLS-1$ new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$ createCollection(items[i], testClass))); } else if (items[i].getName().equals("map")) { // $NON-NLS-1$ map.put(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$ new MapProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$ createMap(items[i], testClass))); }
Clone fragments detected by clone detection tool
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: 8 Number of AST nodes: 6
1
if (items[i].getName().equals("collection")) { // $NON-NLS-1$ 
1
if (items[i].getName().equals("testelement")) { // $NON-NLS-1$ 
2
				coll.add(new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
2
				map.put(items[i].getAttribute("name", ""), new TestElementProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
3
						createCollection(items[i], testClass)));
3
						createTestElement(items[i])));
4
			} else if (items[i].getName().equals("string")) { // $NON-NLS-1$ 
4
			} else if (items[i].getName().equals("collection")) { // $NON-NLS-1$ 
5
                JMeterProperty prop = createProperty(items[i], testClass);
6
				if (prop!=null) {
7
				    coll.add(prop);
8
				}
5
				map.put(items[i].getAttribute("name"),  // $NON-NLS-1$ 
6
						new CollectionProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
7
						createCollection(items[i], testClass)));
9
			} else if (items[i].getName().equals("map")) { // $NON-NLS-1$ 
8
			} else if (items[i].getName().equals("map")) { // $NON-NLS-1$ 
10
				coll.add(new MapProperty(items[i].getAttribute("name", ""), 
9
				map.put(items[i].getAttribute("name", ""),  // $NON-NLS-1$ // $NON-NLS-2$
10
						new MapProperty(items[i].getAttribute("name", ""), // $NON-NLS-1$ // $NON-NLS-2$
11
createMap(items[i], testClass))); // $NON-NLS-1$ // $NON-NLS-2$
11
						createMap(items[i], testClass)));
12
			}
12
			}
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons3