if (s.length > 0) { NoneSelector ns = new NoneSelector(); for (int i = 0; i < s.length; i++) { ns.appendSelector(s[i]); } fs.appendSelector(ns); }
if (0 != specifications.length) { System.out.println("Specifications Supported By Library:"); for (int i = 0; i < specifications.length; i++) { final Specification specification = specifications[ i ]; displaySpecification(specification); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Sync.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/LibraryDisplayer.java
Method name: int[] removeOrphanFiles(Set, File) Method name: void displayLibrary(File, Manifest)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (s.length > 0) {
1
if (0 != specifications.length) {
2
                NoneSelector ns = new NoneSelector();
2
            
3
    
3
System.out.println("Specifications Supported By Library:");
4
            for (int i = 0; i < s.length; i++) {
4
            for (int i = 0; i < specifications.length; i++) {
5
                    ns.appendSelector(s[i]);
5
                
6
                }
7
                fs.appendSelector(ns);
8
    
6
final Specification specification = specifications[ i ];
7
                displaySpecification(specification);
8
            }
9
        }
9
        }
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 comparisons8
  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 fragment3
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    16
    NoneSelector ns = new NoneSelector();
                                                                                  
                                                                                                                                  
    28
    System.out.println("Specifications Supported By Library:");
    17
    for (int i = 0; i < s.length; i++)
    17
    for (int i = 0; i < s.length; i++)
    29
    for (int i = 0; i < specifications.length; i++)
    Differences
    Expression1Expression2Difference
    sspecificationsVARIABLE_NAME_MISMATCH
    org.apache.tools.ant.types.selectors.FileSelector[]org.apache.tools.ant.taskdefs.optional.extension.Specification[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.types.selectors.FileSelector[] of variable s does not match with type org.apache.tools.ant.taskdefs.optional.extension.Specification[] of variable specifications
    • Make classes org.apache.tools.ant.types.selectors.FileSelector[] and org.apache.tools.ant.taskdefs.optional.extension.Specification[] extend a common superclass
    29
    for (int i = 0; i < specifications.length; i++)
    18
    ns.appendSelector(s[i]);
    18
    ns.appendSelector(s[i]);
    Preondition Violations
    Unmatched statement ns.appendSelector(s[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                            
                                                                                                                    
    30
    final Specification specification = specifications[i];
    Preondition Violations
    Unmatched statement final Specification specification=specifications[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    30
    final Specification specification = specifications[i];
                                                                                    
    31
    displaySpecification(specification);
    Precondition Violations (3)
    Row Violation
    1Type org.apache.tools.ant.types.selectors.FileSelector[] of variable s does not match with type org.apache.tools.ant.taskdefs.optional.extension.Specification[] of variable specifications
    2Unmatched statement ns.appendSelector(s[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement final Specification specification=specifications[i]; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted