Constructor constructor = null; try { constructor = args[0].getConstructor(new Class[] {}); } catch (NoSuchMethodException ex) { constructor = args[0].getConstructor(new Class[] {Project.class}); } String propName = getPropertyName(name, "addConfigured");
Constructor constructor = null; try { constructor = args[0].getConstructor(new Class[] {}); } catch (NoSuchMethodException ex) { constructor = args[0].getConstructor(new Class[] {Project.class}); } String propName = getPropertyName(name, "add");
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java
Method name: void IntrospectionHelper(Class) Method name: void IntrospectionHelper(Class)
Number of AST nodes: 4 Number of AST nodes: 4
1
Constructor constructor = null;
1
Constructor constructor = null;
2
                    try {
2
                    try {
3
                        constructor = args[0].getConstructor(new Class[] {});
3
                        constructor = args[0].getConstructor(new Class[] {});
4
                    } catch (NoSuchMethodException ex) {
4
                    } catch (NoSuchMethodException ex) {
5
                        constructor =
5
                        constructor =
6
                            args[0].getConstructor(new Class[] {Project.class});
6
                            args[0].getConstructor(new Class[] {Project.class});
7
                    }
7
                    }
8
                    String propName = getPropertyName(name, "addConfigured");
8
                    String propName = getPropertyName(name, "add");
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.6
Clones locationClones are in the same method
Number of node comparisons10
  1. {Non-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)2.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    33
    Constructor constructor = null;
    41
    Constructor constructor = null;
    34
    try
    42
    try
    35
    constructor = args[0].getConstructor(new Class[] {});
    43
    constructor = args[0].getConstructor(new Class[] {});
    36
    String propName = getPropertyName(name, "addConfigured");
    36
    String propName = getPropertyName(name, "addConfigured");
    44
    String propName = getPropertyName(name, "add");
    Differences
    Expression1Expression2Difference
    "addConfigured""add"LITERAL_VALUE_MISMATCH
    44
    String propName = getPropertyName(name, "add");
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables propName, constructor , while Clone fragment #2 returns variables propName, constructor