if (mapper != null) { throw new BuildException(ERROR_TOO_MANY_MAPPERS); } mapper = newMapper;
if (in != null) { in.close(); slack = null; in = null; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/SignJar.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ReaderInputStream.java
Method name: void add(FileNameMapper) Method name: void close()
Number of AST nodes: 3 Number of AST nodes: 4
1
if (mapper != null) {
1
if (in != null) {
2
            throw new BuildException(ERROR_TOO_MANY_MAPPERS);
2
            
3
        }
4
        mapper = newMapper;
3
in.close();
4
            slack = null;
5
            in = null;
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.1
Clones locationClones are in different classes
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (mapper != null)
    1
    if (mapper != null)
    1
    if (in != null)
    Differences
    Expression1Expression2Difference
    mapperinVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.util.FileNameMapperjava.io.ReaderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.util.FileNameMapper of variable mapper does not match with type java.io.Reader of variable in
    • Make classes org.apache.tools.ant.util.FileNameMapper and java.io.Reader extend a common superclass
    1
    if (in != null)
                                
    2
    in.close();
    2
    throw new BuildException(ERROR_TOO_MANY_MAPPERS);
    2
    throw new BuildException(ERROR_TOO_MANY_MAPPERS);
    Preondition Violations
    Unmatched throw new BuildException(ERROR_TOO_MANY_MAPPERS);
                                                                                                            
                                
    3
    slack = null;
                          
    4
    in = null;
    3
    mapper = newMapper;
                                            
    Precondition Violations (2)
    Row Violation
    1Type org.apache.tools.ant.util.FileNameMapper of variable mapper does not match with type java.io.Reader of variable in
    2Unmatched throw new BuildException(ERROR_TOO_MANY_MAPPERS);