if (initialized) { return; } options = convertRegexOptions(flags); if (from == null) { throw new BuildException("Missing pattern in replaceregex"); } regularExpression = new RegularExpression(); regularExpression.setPattern(from); regexp = regularExpression.getRegexp(getProject());
if (initialized) { return; } options = convertRegexOptions(flags); if (from == null) { throw new BuildException("Missing from in containsregex"); } regularExpression = new RegularExpression(); regularExpression.setPattern(from); regexp = regularExpression.getRegexp(getProject());
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TokenFilter.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TokenFilter.java
Method name: void initialize() Method name: void initialize()
Number of AST nodes: 8 Number of AST nodes: 8
1
if (initialized) {
1
if (initialized) {
2
                return;
2
                return;
3
            }
3
            }
4
            options = convertRegexOptions(flags);
4
            options = convertRegexOptions(flags);
5
            if (from == null) {
5
            if (from == null) {
6
                throw new BuildException("Missing pattern in replaceregex");
6
                throw new BuildException("Missing from in containsregex");
7
            }
7
            }
8
            regularExpression = new RegularExpression();
8
            regularExpression = new RegularExpression();
9
            regularExpression.setPattern(from);
9
            regularExpression.setPattern(from);
10
            regexp = regularExpression.getRegexp(getProject());
10
            regexp = regularExpression.getRegexp(getProject());
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.2
Clones locationClones are in the same java file
Number of node comparisons16
  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)17.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (initialized)
    1
    if (initialized)
    2
    return;
    2
    return;
    2
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    2
    return;
    3
    options = convertRegexOptions(flags);
    3
    options = convertRegexOptions(flags);
    4
    if (from == null)
    4
    if (from == null)
    5
    throw new BuildException("Missing pattern in replaceregex");
    5
    throw new BuildException("Missing pattern in replaceregex");
    5
    throw new BuildException("Missing from in containsregex");
    Differences
    Expression1Expression2Difference
    "Missing pattern in replaceregex""Missing from in containsregex"LITERAL_VALUE_MISMATCH
    5
    throw new BuildException("Missing from in containsregex");
    6
    regularExpression = new RegularExpression();
    6
    regularExpression = new RegularExpression();
    7
    regularExpression.setPattern(from);
    7
    regularExpression.setPattern(from);
    8
    regexp = regularExpression.getRegexp(getProject());
    8
    regexp = regularExpression.getRegexp(getProject());
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;