if ((JavaEnvUtils.isKaffe() && choice == null) || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) { return new KaffeNative2Ascii(); } else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) { return new SunNative2Ascii(); } else if (choice != null) { return resolveClassName(choice); } // This default has been good enough until Ant 1.6.3, so stick // with it return new SunNative2Ascii();
if ((JavaEnvUtils.isKaffe() && choice == null) || Kaffeh.IMPLEMENTATION_NAME.equals(choice)) { return new Kaffeh(); } else if (SunJavah.IMPLEMENTATION_NAME.equals(choice)) { return new SunJavah(); } else if (choice != null) { return resolveClassName(choice); } // This default has been good enough until Ant 1.6.3, so stick // with it return new SunJavah();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/native2ascii/Native2AsciiAdapterFactory.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/javah/JavahAdapterFactory.java
Method name: Native2AsciiAdapter getAdapter(String, ProjectComponent) Method name: JavahAdapter getAdapter(String, ProjectComponent)
Number of AST nodes: 7 Number of AST nodes: 7
1
if ((JavaEnvUtils.isKaffe() && choice == null)
1
if ((JavaEnvUtils.isKaffe() && choice == null)
2
            || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
2
            || Kaffeh.IMPLEMENTATION_NAME.equals(choice)) {
3
            return new KaffeNative2Ascii();
3
            return new Kaffeh();
4
        } else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice)) {
4
        } else if (SunJavah.IMPLEMENTATION_NAME.equals(choice)) {
5
            return new SunNative2Ascii();
5
            return new SunJavah();
6
        } else if (choice != null) {
6
        } else if (choice != null) {
7
            return resolveClassName(choice);
7
            return resolveClassName(choice);
8
        }
8
        }
9
        // This default has been good enough until Ant 1.6.3, so stick
9
        // This default has been good enough until Ant 1.6.3, so stick
10
        // with it
10
        // with it
11
        return new SunNative2Ascii();
11
        return new SunJavah();
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)1.9
Clones locationClones are in different classes
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if ((JavaEnvUtils.isKaffe() && choice == null) || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice))
    1
    if ((JavaEnvUtils.isKaffe() && choice == null) || KaffeNative2Ascii.IMPLEMENTATION_NAME.equals(choice))
    1
    if ((JavaEnvUtils.isKaffe() && choice == null) || Kaffeh.IMPLEMENTATION_NAME.equals(choice))
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.native2ascii.KaffeNative2Asciiorg.apache.tools.ant.taskdefs.optional.javah.KaffehVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.optional.native2ascii.KaffeNative2Ascii of variable KaffeNative2Ascii does not match with type org.apache.tools.ant.taskdefs.optional.javah.Kaffeh of variable Kaffeh
    • Make classes org.apache.tools.ant.taskdefs.optional.native2ascii.KaffeNative2Ascii and org.apache.tools.ant.taskdefs.optional.javah.Kaffeh extend a common superclass
    1
    if ((JavaEnvUtils.isKaffe() && choice == null) || Kaffeh.IMPLEMENTATION_NAME.equals(choice))
                                                  
    2
    return new Kaffeh();
    Preondition Violations
    Unmatched return new Kaffeh();
    2
    return new Kaffeh();
    2
    return new KaffeNative2Ascii();
    2
    return new KaffeNative2Ascii();
    Preondition Violations
    Unmatched return new KaffeNative2Ascii();
                                                                        
    3
    else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice))
    3
    else if (SunNative2Ascii.IMPLEMENTATION_NAME.equals(choice))
    3
    else if (SunJavah.IMPLEMENTATION_NAME.equals(choice))
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Asciiorg.apache.tools.ant.taskdefs.optional.javah.SunJavahVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii of variable SunNative2Ascii does not match with type org.apache.tools.ant.taskdefs.optional.javah.SunJavah of variable SunJavah
    • Make classes org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii and org.apache.tools.ant.taskdefs.optional.javah.SunJavah extend a common superclass
    3
    else if (SunJavah.IMPLEMENTATION_NAME.equals(choice))
                                                      
    4
    return new SunJavah();
    Preondition Violations
    Unmatched return new SunJavah();
    4
    return new SunJavah();
    4
    return new SunNative2Ascii();
    4
    return new SunNative2Ascii();
    Preondition Violations
    Unmatched return new SunNative2Ascii();
                                                                    
    5
    else if (choice != null)
    5
    else if (choice != null)
    6
    return resolveClassName(choice);
    6
    return resolveClassName(choice);
                                                      
    7
    return new SunJavah();
    Preondition Violations
    Unmatched return new SunJavah();
    7
    return new SunJavah();
    7
    return new SunNative2Ascii();
    7
    return new SunNative2Ascii();
    Preondition Violations
    Unmatched return new SunNative2Ascii();
                                                                    
    Precondition Violations (8)
    Row Violation
    1Type org.apache.tools.ant.taskdefs.optional.native2ascii.KaffeNative2Ascii of variable KaffeNative2Ascii does not match with type org.apache.tools.ant.taskdefs.optional.javah.Kaffeh of variable Kaffeh
    2Unmatched return new Kaffeh();
    3Unmatched return new KaffeNative2Ascii();
    4Type org.apache.tools.ant.taskdefs.optional.native2ascii.SunNative2Ascii of variable SunNative2Ascii does not match with type org.apache.tools.ant.taskdefs.optional.javah.SunJavah of variable SunJavah
    5Unmatched return new SunJavah();
    6Unmatched return new SunNative2Ascii();
    7Unmatched return new SunJavah();
    8Unmatched return new SunNative2Ascii();