Method executeM = null; executeM = dispatchable.getClass().getMethod( methodName, new Class[0]); if (executeM == null) { throw new BuildException( "No public " + methodName + "() in " + dispatchable.getClass()); } executeM.invoke(dispatchable, (Object[]) null);
Method executeM = null; executeM = task.getClass().getMethod(methodName, new Class[0]); if (executeM == null) { throw new BuildException("No public " + methodName + "() in " + task.getClass()); } executeM.invoke(task, (Object[]) null);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/dispatch/DispatchUtils.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/dispatch/DispatchUtils.java
Method name: void execute(Object) Method name: void execute(Object)
Number of AST nodes: 5 Number of AST nodes: 5
1
Method executeM = null;
1
Method executeM = null;
2
                                    executeM = dispatchable.getClass().getMethod(
2
                
3
                                        methodName, new Class[0]);
3
executeM = task.getClass().getMethod(methodName, new Class[0]);
4
                                    if (executeM == null) {
4
                if (executeM == null) {
5
                                        throw new BuildException(
5
                    throw new BuildException(
6
                                            "No public " + methodName + "() in "
6
"No public " + methodName + "() in "
7
                                            + dispatchable.getClass());
7
                        + task.getClass());
8
                                    }
8
                
9
                    
9
}
10
                executeM.invoke(dispatchable, (Object[]) null);
10
                executeM.invoke(task, (Object[]) null);
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 the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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
    27
    Method executeM = null;
    37
    Method executeM = null;
    28
    executeM = dispatchable.getClass().getMethod(methodName, new Class[0]);
    28
    executeM = dispatchable.getClass().getMethod(methodName, new Class[0]);
    38
    executeM = task.getClass().getMethod(methodName, new Class[0]);
    Differences
    Expression1Expression2Difference
    dispatchabletaskVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.dispatch.Dispatchablejava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task
    • Make classes org.apache.tools.ant.dispatch.Dispatchable and java.lang.Object extend a common superclass
    38
    executeM = task.getClass().getMethod(methodName, new Class[0]);
    29
    if (executeM == null)
    39
    if (executeM == null)
    30
    throw new BuildException("No public " + methodName + "() in " + dispatchable.getClass());
    30
    throw new BuildException("No public " + methodName + "() in " + dispatchable.getClass());
    40
    throw new BuildException("No public " + methodName + "() in " + task.getClass());
    Differences
    Expression1Expression2Difference
    dispatchabletaskVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.dispatch.Dispatchablejava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task
    • Make classes org.apache.tools.ant.dispatch.Dispatchable and java.lang.Object extend a common superclass
    40
    throw new BuildException("No public " + methodName + "() in " + task.getClass());
    31
    executeM.invoke(dispatchable, (Object[])null);
    31
    executeM.invoke(dispatchable, (Object[])null);
    41
    executeM.invoke(task, (Object[])null);
    Differences
    Expression1Expression2Difference
    dispatchabletaskVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.dispatch.Dispatchablejava.lang.ObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task
    • Make classes org.apache.tools.ant.dispatch.Dispatchable and java.lang.Object extend a common superclass
    41
    executeM.invoke(task, (Object[])null);
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task
    2Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task
    3Type org.apache.tools.ant.dispatch.Dispatchable of variable dispatchable does not match with type java.lang.Object of variable task