if (startIndex < 0) throw new IllegalArgumentException("startIndex must be >= 0"); if (resultCount <= 0) throw new IllegalArgumentException("resultCount must be > 0"); Command command = new SearchCommand(new SearchCommandReference(searchTerm, startIndex, resultCount, searchInside)); // fire up search command CommandProcessor.getInstance().addOp(command);
if (startIndex < 0) throw new IllegalArgumentException("startIndex must be >= 0"); if (resultCount <= 0) throw new IllegalArgumentException("resultCount must be > 0"); Command command = new SearchCommand(new SearchCommandReference(searchTerm, providerName, startIndex, resultCount)); // fire up search command CommandProcessor.getInstance().addOp(command);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/search/SearchManager.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/search/SearchManager.java
Method name: void executeSearch(String, boolean, int, int) Method name: void executeSearch(String, String, boolean, int, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (startIndex < 0)
1
if (startIndex < 0)
2
			throw new IllegalArgumentException("startIndex must be >= 0");
2
			throw new IllegalArgumentException("startIndex must be >= 0");
3
		if (resultCount <= 0)
3
		if (resultCount <= 0)
4
			throw new IllegalArgumentException("resultCount must be > 0");
4
			throw new IllegalArgumentException("resultCount must be > 0");
5
	
5
		Command command = new SearchCommand(new SearchCommandReference(searchTerm,
6
		Command command = new SearchCommand(new SearchCommandReference(searchTerm,
6
				startIndex, resultCount, searchInside));
7
				providerName, startIndex, resultCount
7
		
8
));
8
		// fire up search command
9
		// fire up search command
9
		CommandProcessor.getInstance().addOp(command);
10
		CommandProcessor.getInstance().addOp(command);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.3
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (startIndex < 0)
    5
    if (startIndex < 0)
    4
    throw new IllegalArgumentException("startIndex must be >= 0");
    6
    throw new IllegalArgumentException("startIndex must be >= 0");
    5
    if (resultCount <= 0)
    7
    if (resultCount <= 0)
    6
    throw new IllegalArgumentException("resultCount must be > 0");
    8
    throw new IllegalArgumentException("resultCount must be > 0");
    7
    Command command = new SearchCommand(new SearchCommandReference(searchTerm, startIndex, resultCount, searchInside));
    7
    Command command = new SearchCommand(new SearchCommandReference(searchTerm, startIndex, resultCount, searchInside));
    9
    Command command = new SearchCommand(new SearchCommandReference(searchTerm, providerName, startIndex, resultCount));
    Differences
    Expression1Expression2Difference
    startIndexproviderNameVARIABLE_NAME_MISMATCH
    intjava.lang.StringVARIABLE_TYPE_MISMATCH
    resultCountstartIndexVARIABLE_NAME_MISMATCH
    searchInsideresultCountVARIABLE_NAME_MISMATCH
    booleanintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable startIndex does not match with type java.lang.String of variable providerName
    Type boolean of variable searchInside does not match with type int of variable resultCount
    9
    Command command = new SearchCommand(new SearchCommandReference(searchTerm, providerName, startIndex, resultCount));
    8
    CommandProcessor.getInstance().addOp(command);
    10
    CommandProcessor.getInstance().addOp(command);
    Precondition Violations (2)
    Row Violation
    1Type int of variable startIndex does not match with type java.lang.String of variable providerName
    2Type boolean of variable searchInside does not match with type int of variable resultCount