RuntimeConfigurable childWrapper = (RuntimeConfigurable) e.nextElement(); UnknownElement childElement = new UnknownElement(childWrapper.getElementTag()); parentElement.addChild(childElement); childElement.setProject(getProject()); childElement.setRuntimeConfigurableWrapper(childWrapper); childWrapper.setProxy(childElement); replaceChildren(childWrapper, childElement);
Execute exe = new Execute(streamhandler, null); exe.setAntRun(getProject()); if (topDir == null) { topDir = getProject().getBaseDir(); } exe.setWorkingDirectory(topDir); exe.setCommandline(toExecute.getCommandline()); return exe;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Task.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java
Method name: void replaceChildren(RuntimeConfigurable, UnknownElement) Method name: Execute getExecute(Commandline, ExecuteStreamHandler)
Number of AST nodes: 7 Number of AST nodes: 7
1
RuntimeConfigurable childWrapper =
2
                (RuntimeConfigurable) e.nextElement();
1
Execute exe = new Execute(streamhandler, null);
3
            UnknownElement childElement =
2
        
4
                new UnknownElement(childWrapper.getElementTag());
5
            parentElement.addChild(childElement);
6
            childElement.s
3
exe.setAntRun(getProject());
4
        if (topDir == null) {
7
etProject(getProject());
5
            topDir = getProject().getBaseDir();
8
        
6
        }
9
    childElement.setRuntimeConfigurableWrapper(childWrapper);
7
    
10
            childWrapper.setProxy(childElement
8
    exe.setWorkingDirectory(topDir);
11
);
9
        exe.setCommandline(toExecute.getCommandline());
12
            replaceChildren(childWrapper, childElement);
10
        return exe;
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons33
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                  
    1
    Execute exe = new Execute(streamhandler, null);
                                                                  
    2
    exe.setAntRun(getProject());
                                              
    3
    if (topDir == null)
                                                                            
    4
    topDir = getProject().getBaseDir();
    3
    RuntimeConfigurable childWrapper = (RuntimeConfigurable)e.nextElement();
    3
    RuntimeConfigurable childWrapper = (RuntimeConfigurable)e.nextElement();
    Preondition Violations
    Unmatched statement RuntimeConfigurable childWrapper=(RuntimeConfigurable)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                      
    4
    UnknownElement childElement = new UnknownElement(childWrapper.getElementTag());
    4
    UnknownElement childElement = new UnknownElement(childWrapper.getElementTag());
    Preondition Violations
    Unmatched statement UnknownElement childElement=new UnknownElement(childWrapper.getElementTag()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                    
                                                                          
    5
    exe.setWorkingDirectory(topDir);
    5
    parentElement.addChild(childElement);
                                                                                    
    6
    childElement.setProject(getProject());
                                                                                      
                                
    7
    return exe;
    Preondition Violations
    Unmatched return exe;
    7
    return exe;
    7
    childElement.setRuntimeConfigurableWrapper(childWrapper);
                                                                                                                            
    8
    childWrapper.setProxy(childElement);
                                                                                  
    9
    replaceChildren(childWrapper, childElement);
    9
    replaceChildren(childWrapper, childElement);
    6
    exe.setCommandline(toExecute.getCommandline());
    Differences
    Expression1Expression2Difference
    replaceChildrensetCommandlineMETHOD_INVOCATION_NAME_MISMATCH
    replaceChildren(childWrapper,childElement)exe.setCommandline(toExecute.getCommandline())ARGUMENT_NUMBER_MISMATCH
    exeMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized
    Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized
    Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized
    Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized
    6
    exe.setCommandline(toExecute.getCommandline());
    Precondition Violations (7)
    Row Violation
    1Unmatched statement RuntimeConfigurable childWrapper=(RuntimeConfigurable)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement UnknownElement childElement=new UnknownElement(childWrapper.getElementTag()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return exe;
    4Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized
    5Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized
    6Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized
    7Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized