boolean matchExists = matcher.contains(input, templatePattern); if (startsWith) { if (matchExists) { combined.add(new Integer(matcher.getMatch().group(1))); } combined.add(iter.next()); } else { combined.add(iter.next()); if (matchExists) { combined.add(new Integer(matcher.getMatch().group(1))); } }
boolean matchExists = matcher.contains(input, templatePattern); if (startsWith) { if (matchExists) { combined.add(new Integer(matcher.getMatch().group(1))); } combined.add(iter.next()); } else { combined.add(iter.next()); if (matchExists) { combined.add(new Integer(matcher.getMatch().group(1))); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/extractor/RegexExtractor.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/RegexFunction.java
Method name: void initTemplate() Method name: Object[] generateTemplate(String)
Number of AST nodes: 8 Number of AST nodes: 8
1
boolean matchExists = matcher.contains(input, templatePattern);
1
boolean matchExists = matcher.contains(input, templatePattern);
2
			if (startsWith) {
2
			if (startsWith) {
3
				if (matchExists) {
3
				if (matchExists) {
4
					combined.add(new Integer(matcher.getMatch().group(1)));
4
					combined.add(new Integer(matcher.getMatch().group(1)));
5
				}
5
				}
6
				combined.add(iter.next());
6
				combined.add(iter.next());
7
			} else {
7
			} else {
8
				combined.add(iter.next());
8
				combined.add(iter.next());
9
				if (matchExists) {
9
				if (matchExists) {
10
					combined.add(new Integer(matcher.getMatch().group(1)));
10
					combined.add(new Integer(matcher.getMatch().group(1)));
11
				}
11
				}
12
			}
12
			}
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.4
Clones locationClones are in different classes
Number of node comparisons18
  1. {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)81.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    boolean matchExists = matcher.contains(input, templatePattern);
    9
    boolean matchExists = matcher.contains(input, templatePattern);
    19
    if (startsWith)
    19
    if (startsWith)
    10
    if (startsWith)
    Differences
    Expression1Expression2Difference
    startsWithstartsWithIF_ELSE_SYMMETRICAL_MATCH
    10
    if (startsWith)
    20
    if (matchExists)
    15
    if (matchExists)
    21
    combined.add(new Integer(matcher.getMatch().group(1)));
    16
    combined.add(new Integer(matcher.getMatch().group(1)));
    22
    combined.add(iter.next());
    14
    combined.add(iter.next());
    else
    else
    23
    combined.add(iter.next());
    13
    combined.add(iter.next());
    24
    if (matchExists)
    11
    if (matchExists)
    25
    combined.add(new Integer(matcher.getMatch().group(1)));
    12
    combined.add(new Integer(matcher.getMatch().group(1)));
    Precondition Violations (0)
    Row Violation