if (regexp == null) { myPattern = pattern; setPatternPending = true; } else { regexp.setPattern(pattern); }
if (dependClasspath == null) { dependClasspath = classpath; } else { dependClasspath.append(classpath); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/RegularExpression.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/depend/Depend.java
Method name: void setPattern(String) Method name: void setClasspath(Path)
Number of AST nodes: 4 Number of AST nodes: 3
1
if (regexp == null) {
1
if (dependClasspath == null) {
2
            myPattern = pattern;
2
            
3
            setPatternPending = true;
4
        } else {
5
            regexp.setPattern(pattern
3
dependClasspath = classpath;
4
        } else {
6
);
5
            dependClasspath.append(classpath);
7
        }
6
        }
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 different classes having the same super class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)16.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (regexp == null)
    1
    if (regexp == null)
    1
    if (dependClasspath == null)
    Differences
    Expression1Expression2Difference
    regexpdependClasspathVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.util.regexp.Regexporg.apache.tools.ant.types.PathVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.util.regexp.Regexp of variable regexp does not match with type org.apache.tools.ant.types.Path of variable dependClasspath
    • Make classes org.apache.tools.ant.util.regexp.Regexp and org.apache.tools.ant.types.Path extend a common superclass
    1
    if (dependClasspath == null)
                                                              
    2
    dependClasspath = classpath;
    2
    myPattern = pattern;
                                              
    3
    setPatternPending = true;
                                                        
    else
            
                                                                              
    3
    dependClasspath.append(classpath);
    4
    regexp.setPattern(pattern);
                                                                
    Precondition Violations (1)
    Row Violation
    1Type org.apache.tools.ant.util.regexp.Regexp of variable regexp does not match with type org.apache.tools.ant.types.Path of variable dependClasspath