if (type == null) { throw new BuildException( "classname attribute must be set for provider element", getLocation()); } if (type.length() == 0) { throw new BuildException( "Invalid empty classname", getLocation()); }
if (type == null) { throw new BuildException( "type attribute must be set for service element", getLocation()); } if (type.length() == 0) { throw new BuildException( "Invalid empty type classname", getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/spi/Provider.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/spi/Service.java
Method name: void check() Method name: void check()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (type == null) {
1
if (type == null) {
2
            throw new BuildException(
2
            throw new BuildException(
3
                "classname attribute must be set for provider element",
3
                "type attribute must be set for service element",
4
                getLocation());
4
                getLocation());
5
        }
5
        }
6
        if (type.length() == 0) {
6
        if (type.length() == 0) {
7
            throw new BuildException(
7
            throw new BuildException(
8
                "Invalid empty classname", getLocation());
8
                "Invalid empty type classname", getLocation());
9
        }
9
        }
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (type == null)
    1
    if (type == null)
    2
    throw new BuildException("classname attribute must be set for provider element", getLocation());
    2
    throw new BuildException("classname attribute must be set for provider element", getLocation());
    2
    throw new BuildException("type attribute must be set for service element", getLocation());
    Differences
    Expression1Expression2Difference
    "classname attribute must be set for provider element""type attribute must be set for service element"LITERAL_VALUE_MISMATCH
    2
    throw new BuildException("type attribute must be set for service element", getLocation());
    3
    if (type.length() == 0)
    3
    if (type.length() == 0)
    4
    throw new BuildException("Invalid empty classname", getLocation());
    4
    throw new BuildException("Invalid empty classname", getLocation());
    4
    throw new BuildException("Invalid empty type classname", getLocation());
    Differences
    Expression1Expression2Difference
    "Invalid empty classname""Invalid empty type classname"LITERAL_VALUE_MISMATCH
    4
    throw new BuildException("Invalid empty type classname", getLocation());
    Precondition Violations (0)
    Row Violation