if(settingsDir != null) { String toolsPath = constructPath(settingsDir, "jars", "tools.jar"); paths.addElement(toolsPath); if(new File(toolsPath).exists()) { Log.log(Log.DEBUG, MiscUtilities.class, "- is in the user's jars folder. Fine."); // jEdit will load it automatically return true; } }
if(jEditDir != null) { String toolsPath = constructPath(jEditDir, "jars", "tools.jar"); paths.addElement(toolsPath); if(new File(toolsPath).exists()) { Log.log(Log.DEBUG, MiscUtilities.class, "- is in jEdit's system jars folder. Fine."); // jEdit will load it automatically return true; } }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/MiscUtilities.java
Method name: boolean isToolsJarAvailable() Method name: boolean isToolsJarAvailable()
Number of AST nodes: 6 Number of AST nodes: 6
1
if(settingsDir != null)
1
if(jEditDir != null)
2
		{
2
		{
3
			String toolsPath = constructPath(settingsDir, "jars",
3
			String toolsPath = constructPath(jEditDir, "jars",
4
				"tools.jar");
4
 "tools.jar");
5
			paths.addElement(toolsPath);
5
			paths.addElement(toolsPath);
6
			if(new File(toolsPath).exists())
6
			if(new File(toolsPath).exists())
7
			{
7
			{
8
				Log.log(Log.DEBUG, MiscUtilities.class,
8
				Log.log(Log.DEBUG, MiscUtilities.class,
9
					"- is in the user's jars folder. Fine.");
9
					"- is in jEdit's system jars folder. Fine.");
10
				// jEdit will load it automatically
10
				// jEdit will load it automatically
11
				return true;
11
				return true;
12
			}
12
			}
13
		}
13
		}
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 the same method
Number of node comparisons18
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    if (settingsDir != null)
    10
    if (settingsDir != null)
    17
    if (jEditDir != null)
    Differences
    Expression1Expression2Difference
    settingsDirjEditDirVARIABLE_NAME_MISMATCH
    17
    if (jEditDir != null)
    11
    String toolsPath = constructPath(settingsDir, "jars", "tools.jar");
    11
    String toolsPath = constructPath(settingsDir, "jars", "tools.jar");
    18
    String toolsPath = constructPath(jEditDir, "jars", "tools.jar");
    Differences
    Expression1Expression2Difference
    settingsDirjEditDirVARIABLE_NAME_MISMATCH
    18
    String toolsPath = constructPath(jEditDir, "jars", "tools.jar");
    12
    paths.addElement(toolsPath);
    19
    paths.addElement(toolsPath);
    13
    if (new File(toolsPath).exists())
    20
    if (new File(toolsPath).exists())
    14
    Log.log(Log.DEBUG, MiscUtilities.class, "- is in the user's jars folder. Fine.");
    14
    Log.log(Log.DEBUG, MiscUtilities.class, "- is in the user's jars folder. Fine.");
    21
    Log.log(Log.DEBUG, MiscUtilities.class, "- is in jEdit's system jars folder. Fine.");
    Differences
    Expression1Expression2Difference
    "- is in the user's jars folder. Fine.""- is in jEdit's system jars folder. Fine."LITERAL_VALUE_MISMATCH
    21
    Log.log(Log.DEBUG, MiscUtilities.class, "- is in jEdit's system jars folder. Fine.");
    15
    return true;
    15
    return true;
    22
    return true;
    Preondition Violations
    Conditional return true;
    Conditional return true;
    22
    return true;
    Precondition Violations (2)
    Row Violation
    1Conditional return true;
    2Conditional return true;