TelnetSubTask task = (TelnetSubTask) new TelnetWrite(); telnetTasks.addElement(task); return task;
FileOutputStream outstream = new FileOutputStream(propsFile); props.store(outstream, "Ant JUnitTask generated properties file"); outstream.close();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Method name: TelnetSubTask createWrite() Method name: TestResultHolder executeAsForked(JUnitTest, ExecuteWatchdog, File)
Number of AST nodes: 3 Number of AST nodes: 3
1
TelnetSubTask task = (TelnetSubTask) new TelnetWrite();
1
FileOutputStream outstream = new FileOutputStream(propsFile);
2
        telnetTasks.addElement(task);
2
          
3
        return task
3
  props.store(outstream, "Ant JUnitTask generated properties file");
4
;
4
            outstream.close();
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 comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    TelnetSubTask task = (TelnetSubTask)new TelnetWrite();
                                                                                                                  
    2
    telnetTasks.addElement(task);
    2
    telnetTasks.addElement(task);
    55
    props.store(outstream, "Ant JUnitTask generated properties file");
    Differences
    Expression1Expression2Difference
    addElementstoreMETHOD_INVOCATION_NAME_MISMATCH
    telnetTaskspropsVARIABLE_NAME_MISMATCH
    java.util.Vectorjava.util.PropertiesSUBCLASS_TYPE_MISMATCH
    telnetTasks.addElement(task)props.store(outstream,"Ant JUnitTask generated properties file")ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression telnetTasks.addElement(task) is a void method call, and thus it cannot be parameterized
    Expression props.store(outstream,"Ant JUnitTask generated properties file") is a void method call, and thus it cannot be parameterized
    Expression telnetTasks.addElement(task) is a void method call, and thus it cannot be parameterized
    Expression props.store(outstream,"Ant JUnitTask generated properties file") is a void method call, and thus it cannot be parameterized
    55
    props.store(outstream, "Ant JUnitTask generated properties file");
    3
    return task;
    3
    return task;
    Preondition Violations
    Unmatched return task;
                                  
    Precondition Violations (5)
    Row Violation
    1Expression telnetTasks.addElement(task) is a void method call, and thus it cannot be parameterized
    2Expression props.store(outstream,"Ant JUnitTask generated properties file") is a void method call, and thus it cannot be parameterized
    3Expression telnetTasks.addElement(task) is a void method call, and thus it cannot be parameterized
    4Expression props.store(outstream,"Ant JUnitTask generated properties file") is a void method call, and thus it cannot be parameterized
    5Unmatched return task;