final FilterChain filterchain = (FilterChain) filterChains.elementAt(i); final Vector filterReaders = filterchain.getFilterReaders(); final int readerCount = filterReaders.size(); for (int j = 0; j < readerCount; j++) { finalFilters.addElement(filterReaders.elementAt(j)); }
final ExtensionSet set = (ExtensionSet) extensionSets.get(i); final Extension[] extensions = set.toExtensions(getProject()); for (int j = 0; j < extensions.length; j++) { results.add(extensions[ j ]); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/util/ChainReaderHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/JarLibManifestTask.java
Method name: Reader getAssembledReader() Method name: ArrayList toExtensions(ArrayList)
Number of AST nodes: 5 Number of AST nodes: 4
1
final FilterChain filterchain =
1
final 
2
                (FilterChain) filterChains.elementAt(i);
3
            final Vector filterReaders = filterchain.getFilterReaders();
4
            final int readerCount = filterReaders.size(
2
ExtensionSet set = (ExtensionSet) extensionSets.get(i);
5
);
3
            final Extension[] extensions = set.toExtensions(getProject());
6
            for (int j = 0; j < readerCount; j++) {
4
            for (int j = 0; j < extensions.length; j++) {
7
                finalFilters.addElement(filterReaders.elementAt(j));
5
                results.add(extensions[ j ]);
8
            }
6
            }
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.2
Clones locationClones are in different classes
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    7
    final FilterChain filterchain = (FilterChain)filterChains.elementAt(i);
    7
    final FilterChain filterchain = (FilterChain)filterChains.elementAt(i);
    4
    final ExtensionSet set = (ExtensionSet)extensionSets.get(i);
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.types.FilterChainorg.apache.tools.ant.taskdefs.optional.extension.ExtensionSetSUBCLASS_TYPE_MISMATCH
    filterchainsetVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.FilterChainorg.apache.tools.ant.taskdefs.optional.extension.ExtensionSetSUBCLASS_TYPE_MISMATCH
    org.apache.tools.ant.types.FilterChainorg.apache.tools.ant.taskdefs.optional.extension.ExtensionSetSUBCLASS_TYPE_MISMATCH
    elementAtgetMETHOD_INVOCATION_NAME_MISMATCH
    filterChainsextensionSetsVARIABLE_NAME_MISMATCH
    java.util.Vectorjava.util.ArrayListSUBCLASS_TYPE_MISMATCH
    4
    final ExtensionSet set = (ExtensionSet)extensionSets.get(i);
                                                                                                                                  
    5
    final Extension[] extensions = set.toExtensions(getProject());
    Preondition Violations
    Unmatched statement final Extension[] extensions=set.toExtensions(getProject()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    final Extension[] extensions = set.toExtensions(getProject());
    8
    final Vector filterReaders = filterchain.getFilterReaders();
    8
    final Vector filterReaders = filterchain.getFilterReaders();
    Preondition Violations
    Unmatched statement final Vector filterReaders=filterchain.getFilterReaders(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                              
    9
    final int readerCount = filterReaders.size();
    9
    final int readerCount = filterReaders.size();
    Preondition Violations
    Unmatched statement final int readerCount=filterReaders.size(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    10
    for (int j = 0; j < readerCount; j++)
    10
    for (int j = 0; j < readerCount; j++)
    6
    for (int j = 0; j < extensions.length; j++)
    Differences
    Expression1Expression2Difference
    readerCountextensions.lengthTYPE_COMPATIBLE_REPLACEMENT
    6
    for (int j = 0; j < extensions.length; j++)
                                                                
    7
    results.add(extensions[j]);
    Preondition Violations
    Unmatched statement results.add(extensions[j]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    results.add(extensions[j]);
    11
    finalFilters.addElement(filterReaders.elementAt(j));
    11
    finalFilters.addElement(filterReaders.elementAt(j));
    Preondition Violations
    Unmatched statement finalFilters.addElement(filterReaders.elementAt(j)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                    
    Precondition Violations (6)
    Row Violation
    1Unmatched statement final Extension[] extensions=set.toExtensions(getProject()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement final Vector filterReaders=filterchain.getFilterReaders(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement final int readerCount=filterReaders.size(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement results.add(extensions[j]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement finalFilters.addElement(filterReaders.elementAt(j)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Clone fragment #1 returns variables filterchain, j , while Clone fragment #2 returns variables set, j