if (OSInfo.isLinux() || OSInfo.isSolaris()) { if (defaultLinux.exists()) { return defaultLinux; } else if (defaultLocalLinux.exists()) { return defaultLocalLinux; } } /* RIYAD: The Prefs API cannot be used to read the Window's registry, * it is coded to use the registry (if available) as a backing store * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use * the Windows registry and they all required a native lib to do it. */ /* If this is windows, check the default installation location for the * aspell.exe binary. */ if (OSInfo.isWin32Platform() && defaultWin.exists()) { return defaultWin; } /* Couldn't find anything, so return null and let the wizard ask the * user. */ return null;
if (OSInfo.isLinux() || OSInfo.isSolaris()) { if (defaultLinux.exists()) { return defaultLinux; } else if (defaultLocalLinux.exists()) { return defaultLocalLinux; } } /* RIYAD: The Prefs API cannot be used to read the Window's registry, * it is coded to use the registry (if available) as a backing store * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use * the Windows registry and they all required a native lib to do it. */ /* If this is windows, check the default installation location for the * gpg.exe binary. */ if (OSInfo.isWin32Platform() && defaultWin.exists()) { return defaultWin; } /* Couldn't find anything, so return null and let the wizard ask the * user. */ return null;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/externaltools/ASpellPlugin.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/externaltools/GPGPlugin.java
Method name: File locate() Method name: File locate()
Number of AST nodes: 8 Number of AST nodes: 8
1
if (OSInfo.isLinux() || OSInfo.isSolaris()) {
1
if (OSInfo.isLinux() || OSInfo.isSolaris()) {
2
            if (defaultLinux.exists()) {
2
            if (defaultLinux.exists()) {
3
                return defaultLinux;
3
                return defaultLinux;
4
            } else if (defaultLocalLinux.exists()) {
4
            } else if (defaultLocalLinux.exists()) {
5
                return defaultLocalLinux;
5
                return defaultLocalLinux;
6
            }
6
            }
7
        }
7
        }
8
        /* RIYAD: The Prefs API cannot be used to read the Window's registry,
8
        /* RIYAD: The Prefs API cannot be used to read the Window's registry,
9
 * it is coded to use the registry (if available) as a backing store
9
 * it is coded to use the registry (if available) as a backing store
10
 * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER
10
 * on in the SOFTWARE/JavaSoft/Prefs registry keys for HKEY_CURRENT_USER
11
 * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use
11
 * and HKEY_LOCAL_MACHINE paths. I have seen a few java apps that use
12
 * the Windows registry and they all required a native lib to do it.
12
 * the Windows registry and they all required a native lib to do it.
13
 */
13
 */
14
        /* If this is windows, check the default installation location for the
14
        /* If this is windows, check the default installation location for the
15
 * aspell.exe binary.
15
 * gpg.exe binary.
16
 */
16
 */
17
        if (OSInfo.isWin32Platform() && defaultWin.exists()) {
17
        if (OSInfo.isWin32Platform() && defaultWin.exists()) {
18
            return defaultWin;
18
            return defaultWin;
19
        }
19
        }
20
        /* Couldn't find anything, so return null and let the wizard ask the
20
        /* Couldn't find anything, so return null and let the wizard ask the
21
 * user.
21
 * user.
22
 */
22
 */
23
        return null;
23
        return null;
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.7
Clones locationClones are in different classes having the same super class
Number of node comparisons19
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (OSInfo.isLinux() || OSInfo.isSolaris())
    1
    if (OSInfo.isLinux() || OSInfo.isSolaris())
    2
    if (defaultLinux.exists())
    2
    if (defaultLinux.exists())
    3
    return defaultLinux;
    3
    return defaultLinux;
    4
    else if (defaultLocalLinux.exists())
    4
    else if (defaultLocalLinux.exists())
    5
    return defaultLocalLinux;
    5
    return defaultLocalLinux;
    6
    if (OSInfo.isWin32Platform() && defaultWin.exists())
    6
    if (OSInfo.isWin32Platform() && defaultWin.exists())
    7
    return defaultWin;
    7
    return defaultWin;
    8
    return null;
    8
    return null;
    Precondition Violations (0)
    Row Violation