if (regexp != null && regexp.length > 0) { INCPTRN = regexp; this.PTRNFILTER = true; // now we create the compiled pattern and // add it to the arraylist for (int idx = 0; idx < INCPTRN.length; idx++) { this.INCPATTERNS.add(this.createPattern(INCPTRN[idx])); } }
if (regexp != null && regexp.length > 0) { EXCPTRN = regexp; this.PTRNFILTER = true; // now we create the compiled pattern and // add it to the arraylist for (int idx = 0; idx < EXCPTRN.length; idx++) { this.EXCPATTERNS.add(this.createPattern(EXCPTRN[idx])); } }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/LogFilter.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/util/accesslog/LogFilter.java
Method name: void includePattern(String[]) Method name: void excludePattern(String[])
Number of AST nodes: 5 Number of AST nodes: 5
1
if (regexp != null && regexp.length > 0) {
1
if (regexp != null && regexp.length > 0) {
2
			INCPTRN = regexp;
2
			EXCPTRN = regexp;
3
			this.PTRNFILTER = true;
3
			this.PTRNFILTER = true;
4
			// now we create the compiled pattern and
4
			// now we create the compiled pattern and
5
			// add it to the arraylist
5
			// add it to the arraylist
6
			for (int idx = 0; idx < INCPTRN.length; idx++) {
6
			for (int idx = 0; idx < EXCPTRN.length; idx++) {
7
				this.INCPATTERNS.add(this.createPattern(INCPTRN[idx]));
7
				this.EXCPATTERNS.add(this.createPattern(EXCPTRN[idx]));
8
			}
8
			}
9
		}
9
		}
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 comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (regexp != null && regexp.length > 0)
    1
    if (regexp != null && regexp.length > 0)
    2
    INCPTRN = regexp;
    2
    INCPTRN = regexp;
    2
    EXCPTRN = regexp;
    Differences
    Expression1Expression2Difference
    INCPTRNEXCPTRNVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression INCPTRN is a field being modified, and thus it cannot be parameterized
    Expression EXCPTRN is a field being modified, and thus it cannot be parameterized
    2
    EXCPTRN = regexp;
    3
    this.PTRNFILTER = true;
    3
    this.PTRNFILTER = true;
    4
    for (int idx = 0; idx < INCPTRN.length; idx++)
    4
    for (int idx = 0; idx < INCPTRN.length; idx++)
    4
    for (int idx = 0; idx < EXCPTRN.length; idx++)
    Differences
    Expression1Expression2Difference
    INCPTRNEXCPTRNVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression INCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression EXCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    for (int idx = 0; idx < EXCPTRN.length; idx++)
    5
    this.INCPATTERNS.add(this.createPattern(INCPTRN[idx]));
    5
    this.INCPATTERNS.add(this.createPattern(INCPTRN[idx]));
    5
    this.EXCPATTERNS.add(this.createPattern(EXCPTRN[idx]));
    Differences
    Expression1Expression2Difference
    INCPTRNEXCPTRNVARIABLE_NAME_MISMATCH
    INCPATTERNSEXCPATTERNSVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression INCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression EXCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.EXCPATTERNS.add(this.createPattern(EXCPTRN[idx]));
    Precondition Violations (6)
    Row Violation
    1Expression INCPTRN is a field being modified, and thus it cannot be parameterized
    2Expression EXCPTRN is a field being modified, and thus it cannot be parameterized
    3Expression INCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression EXCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression INCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression EXCPTRN cannot be parameterized, because it has dependencies to/from statements that will be extracted