/** This */ private String[] getCompileOptionsAsArray() { Vector options = new Vector(); options.addElement(binary ? "-binary" : "-nobinary"); options.addElement(comments ? "-comments" : "-nocomments"); options.addElement(compile ? "-compile" : "-nocompile"); options.addElement(compact ? "-compact" : "-nocompact"); options.addElement(console ? "-console" : "-noconsole"); options.addElement(crossref ? "-crossref" : "-nocrossref"); options.addElement(decimal ? "-decimal" : "-nodecimal"); options.addElement(diag ? "-diag" : "-nodiag"); options.addElement(explicit ? "-explicit" : "-noexplicit"); options.addElement(format ? "-format" : "-noformat"); options.addElement(keep ? "-keep" : "-nokeep"); options.addElement(logo ? "-logo" : "-nologo"); options.addElement(replace ? "-replace" : "-noreplace"); options.addElement(savelog ? "-savelog" : "-nosavelog"); options.addElement(sourcedir ? "-sourcedir" : "-nosourcedir"); options.addElement(strictargs ? "-strictargs" : "-nostrictargs"); options.addElement(strictassign ? "-strictassign" : "-nostrictassign"); options.addElement(strictcase ? "-strictcase" : "-nostrictcase"); options.addElement(strictimport ? "-strictimport" : "-nostrictimport"); options.addElement(strictprops ? "-strictprops" : "-nostrictprops"); options.addElement(strictsignal ? "-strictsignal" : "-nostrictsignal"); options.addElement(symbols ? "-symbols" : "-nosymbols"); options.addElement(time ? "-time" : "-notime"); options.addElement("-" + trace); options.addElement(utf8 ? "-utf8" : "-noutf8"); options.addElement("-" + verbose); String[] results = new String[options.size()]; options.copyInto(results); return results; }
/** * process included file * @param name path of the file relative to the directory of the fileset */ private void accountForIncludedFile(String name) { if (!filesIncluded.contains(name) && !filesExcluded.contains(name)) { if (isIncluded(name)) { if (!isExcluded(name)) { filesIncluded.addElement(name); } else { filesExcluded.addElement(name); } } else { filesNotIncluded.addElement(name); } } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/NetRexxC.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/net/FTP.java
Method name: String[] getCompileOptionsAsArray() Method name: void accountForIncludedFile(String)
Number of AST nodes: 1 Number of AST nodes: 3
1
/** This  */
1
/**
2
    private String[] getCompileOptionsAsArray() {
2
         * process included file
3
        Vector options = new Vector();
3
         * @param name  path of the file relative to the directory of the fileset
4
4
         */
5
        options.addElement(binary ? "-binary" : "-nobinary");
5
        private void accountForIncludedFile(String name) {
6
        options.addElement(comments ? "-comments" : "-nocomments");
6
            if (!filesIncluded.contains(name)
7
        options.addElement(compile ? "-compile" : "-nocompile");
7
                && !filesExcluded.contains(name)) {
8
        options.addElement(compact ? "-compact" : "-nocompact");
8
9
        options.addElement(console ? "-console" : "-noconsole");
9
                if (isIncluded(name)) {
10
        options.addElement(crossref ? "-crossref" : "-nocrossref");
10
                    if (!isExcluded(name)) {
11
        options.addElement(decimal ? "-decimal" : "-nodecimal");
11
                        filesIncluded.addElement(name);
12
        options.addElement(diag ? "-diag" : "-nodiag");
12
                    } else {
13
        options.addElement(explicit ? "-explicit" : "-noexplicit");
13
                        filesExcluded.addElement(name);
14
        options.addElement(format ? "-format" : "-noformat");
14
                    }
15
        options.addElement(keep ? "-keep" : "-nokeep");
15
                } else {
16
        options.addElement(logo ? "-logo" : "-nologo");
16
                    filesNotIncluded.addElement(name);
17
        options.addElement(replace ? "-replace" : "-noreplace");
17
                }
18
        options.addElement(savelog ? "-savelog" : "-nosavelog");
18
            }
19
        options.addElement(sourcedir ? "-sourcedir" : "-nosourcedir");
19
        }
20
        options.addElement(strictargs ? "-strictargs" : "-nostrictargs");
21
        options.addElement(strictassign ? "-strictassign" : "-nostrictassign");
22
        options.addElement(strictcase ? "-strictcase" : "-nostrictcase");
23
        options.addElement(strictimport ? "-strictimport" : "-nostrictimport");
24
        options.addElement(strictprops ? "-strictprops" : "-nostrictprops");
25
        options.addElement(strictsignal ? "-strictsignal" : "-nostrictsignal");
26
        options.addElement(symbols ? "-symbols" : "-nosymbols");
27
        options.addElement(time ? "-time" : "-notime");
28
        options.addElement("-" + trace);
29
        options.addElement(utf8 ? "-utf8" : "-noutf8");
30
        options.addElement("-" + verbose);
31
32
        String[] results = new String[options.size()];
33
34
        options.copyInto(results);
35
        return results;
36
    }
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.600
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    options.addElement(binary ? "-binary" : "-nobinary");
    2
    options.addElement(binary ? "-binary" : "-nobinary");
    3
    if (!isExcluded(name))
    Differences
    Expression1Expression2Difference
    binary!isExcluded(name)TYPE_COMPATIBLE_REPLACEMENT
    optionsfilesIncludedVARIABLE_NAME_MISMATCH
    optionsfilesExcludedVARIABLE_NAME_MISMATCH
    "-binary"nameTYPE_COMPATIBLE_REPLACEMENT
    "-nobinary"nameTYPE_COMPATIBLE_REPLACEMENT
    3
    if (!isExcluded(name))
                                                                        
    4
    filesIncluded.addElement(name);
    Differences
    Expression1Expression2Difference
    optionsfilesIncludedVARIABLE_NAME_MISMATCH
    "-binary"nameTYPE_COMPATIBLE_REPLACEMENT
    4
    filesIncluded.addElement(name);
            
    else
                                                                        
    5
    filesExcluded.addElement(name);
    Differences
    Expression1Expression2Difference
    optionsfilesExcludedVARIABLE_NAME_MISMATCH
    "-nobinary"nameTYPE_COMPATIBLE_REPLACEMENT
    5
    filesExcluded.addElement(name);
    Precondition Violations (0)
    Row Violation