if (IS_NETWARE) { // Extrapolating from: // "NetWare may have a "java" in that directory, but 99% of // the time, you don't want to execute it" -- Jeff Tulley // <JTULLEY@novell.com> return command; } File jExecutable = null; if (IS_AIX) { // On IBM's JDK 1.2 the directory layout is different, 1.3 follows // Sun's layout. jExecutable = findInDir(JAVA_HOME + "/sh", command); } if (jExecutable == null) { jExecutable = findInDir(JAVA_HOME + "/bin", command); } if (jExecutable != null) { return jExecutable.getAbsolutePath(); } else { // Unfortunately on Windows java.home doesn't always refer // to the correct location, so we need to fall back to // assuming java is somewhere on the PATH. return addExtension(command); }
if (IS_NETWARE) { // Extrapolating from: // "NetWare may have a "java" in that directory, but 99% of // the time, you don't want to execute it" -- Jeff Tulley // <JTULLEY@novell.com> return command; } File jExecutable = null; if (IS_AIX) { // On IBM's JDK 1.2 the directory layout is different, 1.3 follows // Sun's layout. jExecutable = findInDir(JAVA_HOME + "/../sh", command); } if (jExecutable == null) { jExecutable = findInDir(JAVA_HOME + "/../bin", command); } if (jExecutable != null) { return jExecutable.getAbsolutePath(); } else { // fall back to JRE bin directory, also catches JDK 1.0 and 1.1 // where java.home points to the root of the JDK and Mac OS X where // the whole directory layout is different from Sun's return getJreExecutable(command); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/JavaEnvUtils.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/JavaEnvUtils.java
Method name: String getJreExecutable(String) Method name: String getJdkExecutable(String)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (IS_NETWARE) {
1
if (IS_NETWARE) {
2
            // Extrapolating from:
2
            // Extrapolating from:
3
            // "NetWare may have a "java" in that directory, but 99% of
3
            // "NetWare may have a "java" in that directory, but 99% of
4
            // the time, you don't want to execute it" -- Jeff Tulley
4
            // the time, you don't want to execute it" -- Jeff Tulley
5
            // <JTULLEY@novell.com>
5
            // <JTULLEY@novell.com>
6
            return command;
6
            return command;
7
        }
7
        }
8
        File jExecutable = null;
8
        File jExecutable = null;
9
        if (IS_AIX) {
9
        if (IS_AIX) {
10
            // On IBM's JDK 1.2 the directory layout is different, 1.3 follows
10
            // On IBM's JDK 1.2 the directory layout is different, 1.3 follows
11
            // Sun's layout.
11
            // Sun's layout.
12
            jExecutable = findInDir(JAVA_HOME + "/sh", command);
12
            jExecutable = findInDir(JAVA_HOME + "/../sh", command);
13
        }
13
        }
14
        if (jExecutable == null) {
14
        if (jExecutable == null) {
15
            jExecutable = findInDir(JAVA_HOME + "/bin", command);
15
            jExecutable = findInDir(JAVA_HOME + "/../bin", command);
16
        }
16
        }
17
        if (jExecutable != null) {
17
        if (jExecutable != null) {
18
            return jExecutable.getAbsolutePath();
18
            return jExecutable.getAbsolutePath();
19
        } else {
19
        } else {
20
            // Unfortunately on Windows java.home doesn't always refer
20
            // 
21
            // to the correct location, so we need to fall back to
22
            // assuming java is somewhere on the PATH.
21
fall back to JRE bin directory, also catches JDK 1.0 and 1.1
22
            // where java.home points to the root of the JDK and Mac OS X where
23
            // the whole directory layout is different from Sun's
23
            return addExtension(command);
24
            return getJreExecutable(command);
24
        }
25
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are declared in the same class
Number of node comparisons58
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (IS_NETWARE)
    1
    if (IS_NETWARE)
    2
    return command;
    2
    return command;
    3
    File jExecutable = null;
    3
    File jExecutable = null;
    4
    if (IS_AIX)
    4
    if (IS_AIX)
    5
    jExecutable = findInDir(JAVA_HOME + "/sh", command);
    5
    jExecutable = findInDir(JAVA_HOME + "/sh", command);
    5
    jExecutable = findInDir(JAVA_HOME + "/../sh", command);
    Differences
    Expression1Expression2Difference
    "/sh""/../sh"LITERAL_VALUE_MISMATCH
    5
    jExecutable = findInDir(JAVA_HOME + "/../sh", command);
    6
    if (jExecutable == null)
    6
    if (jExecutable == null)
    7
    jExecutable = findInDir(JAVA_HOME + "/bin", command);
    7
    jExecutable = findInDir(JAVA_HOME + "/bin", command);
    7
    jExecutable = findInDir(JAVA_HOME + "/../bin", command);
    Differences
    Expression1Expression2Difference
    "/bin""/../bin"LITERAL_VALUE_MISMATCH
    7
    jExecutable = findInDir(JAVA_HOME + "/../bin", command);
    8
    if (jExecutable != null)
    8
    if (jExecutable != null)
    9
    return jExecutable.getAbsolutePath();
    9
    return jExecutable.getAbsolutePath();
    else
    else
    10
    return addExtension(command);
    10
    return addExtension(command);
    10
    return getJreExecutable(command);
    Differences
    Expression1Expression2Difference
    addExtensiongetJreExecutableMETHOD_INVOCATION_NAME_MISMATCH
    10
    return getJreExecutable(command);
    Precondition Violations (0)
    Row Violation