String stringToLog = ((CompoundVariable) values[0]).execute(); String priorityString; if (values.length > 1) { // We have a default priorityString = ((CompoundVariable) values[1]).execute(); if (priorityString.length() == 0) { priorityString = DEFAULT_PRIORITY; } } else { priorityString = DEFAULT_PRIORITY; } Throwable t = null;
String stringToLog = ((CompoundVariable) values[0]).execute(); String priorityString; if (values.length > 1) { // We have a default priorityString = ((CompoundVariable) values[1]).execute(); if (priorityString.length() == 0) { priorityString = DEFAULT_PRIORITY; } } else { priorityString = DEFAULT_PRIORITY; } Throwable t = null;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/LogFunction.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/LogFunction2.java
Method name: String execute(SampleResult, Sampler) Method name: String execute(SampleResult, Sampler)
Number of AST nodes: 8 Number of AST nodes: 8
1
String stringToLog = ((CompoundVariable) values[0]).execute();
1
String stringToLog = ((CompoundVariable) values[0]).execute();
2
		String priorityString;
2
		String priorityString;
3
		if (values.length > 1) { // We have a default
3
		if (values.length > 1) { // We have a default
4
			priorityString = ((CompoundVariable) values[1]).execute();
4
			priorityString = ((CompoundVariable) values[1]).execute();
5
			if (priorityString.length() == 0) {
5
			if (priorityString.length() == 0) {
6
				priorityString = DEFAULT_PRIORITY;
6
				priorityString = DEFAULT_PRIORITY;
7
			}
7
			}
8
		} else {
8
		} else {
9
			priorityString = DEFAULT_PRIORITY;
9
			priorityString = DEFAULT_PRIORITY;
10
		}
10
		}
11
		Throwable t = null;
11
		Throwable t = null;
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)11.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    String stringToLog = ((CompoundVariable)values[0]).execute();
    1
    String stringToLog = ((CompoundVariable)values[0]).execute();
    2
    String priorityString;
    2
    String priorityString;
    3
    if (values.length > 1)
    3
    if (values.length > 1)
    4
    priorityString = ((CompoundVariable)values[1]).execute();
    4
    priorityString = ((CompoundVariable)values[1]).execute();
    5
    if (priorityString.length() == 0)
    5
    if (priorityString.length() == 0)
    6
    priorityString = DEFAULT_PRIORITY;
    6
    priorityString = DEFAULT_PRIORITY;
    else
    else
    7
    priorityString = DEFAULT_PRIORITY;
    7
    priorityString = DEFAULT_PRIORITY;
    8
    Throwable t = null;
    8
    Throwable t = null;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables t, stringToLog, priorityString , while Clone fragment #2 returns variables t, stringToLog, priorityString