try { Method method; method = obj.getClass().getMethod( methodName, new Class[] {argType}); return method.invoke(obj, new Object[] {arg}); } catch (Exception t) { throwBuildException(t); return null; // NotReached }
try { Method method; method = obj.getClass().getMethod( methodName, new Class[] {argType1, argType2}); return method.invoke(obj, new Object[] {arg1, arg2}); } catch (Exception t) { throwBuildException(t); return null; // NotReached }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ReflectUtil.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/ReflectUtil.java
Method name: Object invoke(Object, String, Class, Object) Method name: Object invoke(Object, String, Class, Object, Class, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
try {
1
try {
2
            Method method;
2
            Method method;
3
            method = obj.getClass().getMethod(
3
            method = obj.getClass().getMethod(
4
                methodName, new Class[] {argType});
4
                methodName, new Class[] {argType1, argType2});
5
            return method.invoke(obj, new Object[] {arg});
5
            return method.invoke(obj, new Object[] {arg1, arg2});
6
        } catch (Exception t) {
6
        } catch (Exception t) {
7
            throwBuildException(t);
7
            throwBuildException(t);
8
            return null; // NotReached
8
            return null; // NotReached
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.1
Clones locationClones are declared in the same class
Number of node comparisons16
  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)1.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    2
    Method method;
    2
    Method method;
    3
    method = obj.getClass().getMethod(methodName, new Class[] {argType});
    3
    method = obj.getClass().getMethod(methodName, new Class[] {argType});
    3
    method = obj.getClass().getMethod(methodName, new Class[] {argType1, argType2});
    Differences
    Expression1Expression2Difference
    {argType}{argType1,argType2}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {argType}{argType1,argType2}ARRAY_INITIALIZER_MISMATCH
    3
    method = obj.getClass().getMethod(methodName, new Class[] {argType1, argType2});
    4
    return method.invoke(obj, new Object[] {arg});
    4
    return method.invoke(obj, new Object[] {arg});
    4
    return method.invoke(obj, new Object[] {arg1, arg2});
    Differences
    Expression1Expression2Difference
    {arg}{arg1,arg2}ARRAY_INITIALIZER_EXPRESSION_NUMBER_MISMATCH
    {arg}{arg1,arg2}ARRAY_INITIALIZER_MISMATCH
    4
    return method.invoke(obj, new Object[] {arg1, arg2});
    Precondition Violations (0)
    Row Violation