while (it.hasNext()) { ISearchRequest r = it.next(); String providerName = r.getProvider(); if (map.containsKey(providerName)) { Vector<ISearchRequest> v = map.get(providerName); v.add(r); } else { Vector<ISearchRequest> v = new Vector<ISearchRequest>(); v.add(r); map.put(providerName, v); } } // now search through all buckets Iterator<String> it2 = map.keySet().iterator();
while (it.hasNext()) { ISearchRequest r = it.next(); String providerName = r.getProvider(); if (map.containsKey(providerName)) { Vector<ISearchRequest> v = map.get(providerName); v.add(r); } else { Vector<ISearchRequest> v = new Vector<ISearchRequest>(); v.add(r); map.put(providerName, v); } } // now search through all buckets Iterator<String> it2 = map.keySet().iterator();
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/SearchPanel.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/search/SearchManager.java
Method name: void searchComplex(List, boolean, boolean) Method name: void execute(IWorkerStatusController)
Number of AST nodes: 10 Number of AST nodes: 10
1
while (it.hasNext()) {
1
while (it.hasNext()) {
2
			ISearchRequest r = it.next();
2
					ISearchRequest r = it.next();
3
			String providerName = r.getProvider();
3
					String providerName = r.getProvider();
4
			if (map.containsKey(providerName)) {
4
					if (map.containsKey(providerName)) {
5
				Vector<ISearchRequest> v = map.get(providerName);
5
						Vector<ISearchRequest> v = map.get(providerName);
6
				v.add(r);
6
						v.add(r);
7
			} else {
7
					} else {
8
				Vector<ISearchRequest> v = new Vector<ISearchRequest>();
8
						Vector<ISearchRequest> v = new Vector<ISearchRequest>();
9
				v.add(r);
9
						v.add(r);
10
				map.put(providerName, v);
10
						map.put(providerName, v);
11
			}
11
					}
12
		}
12
				}
13
		// now search through all buckets
13
				// now search through all buckets
14
		Iterator<String> it2 = map.keySet().iterator();
14
				Iterator<String> it2 = map.keySet().iterator();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are in different classes
Number of node comparisons47
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)12.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    9
    while (it.hasNext())
    26
    while (it.hasNext())
    10
    ISearchRequest r = it.next();
    27
    ISearchRequest r = it.next();
    11
    String providerName = r.getProvider();
    28
    String providerName = r.getProvider();
    12
    if (map.containsKey(providerName))
    29
    if (map.containsKey(providerName))
    13
    Vector<ISearchRequest> v = map.get(providerName);
    30
    Vector<ISearchRequest> v = map.get(providerName);
    14
    v.add(r);
    31
    v.add(r);
    else
    else
    15
    Vector<ISearchRequest> v = new Vector<ISearchRequest>();
    32
    Vector<ISearchRequest> v = new Vector<ISearchRequest>();
    16
    v.add(r);
    33
    v.add(r);
    17
    map.put(providerName, v);
    34
    map.put(providerName, v);
    18
    Iterator<String> it2 = map.keySet().iterator();
    35
    Iterator<String> it2 = map.keySet().iterator();
    Precondition Violations (0)
    Row Violation