if(isDrive != null) { try { return Boolean.TRUE.equals(isDrive. invoke(fsView, new Object[] { file })); } catch(Exception e) { Log.log(Log.ERROR,this,e); return false; } } else return true;
if(isFloppyDrive != null) { try { return Boolean.TRUE.equals(isFloppyDrive. invoke(fsView, new Object[] { file })); } catch(Exception e) { Log.log(Log.ERROR,this,e); return false; } } else return path.startsWith("A:") || path.startsWith("B:");
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileRootsVFS.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileRootsVFS.java
Method name: boolean isDrive(File) Method name: boolean isFloppy(File)
Number of AST nodes: 4 Number of AST nodes: 4
1
if(isDrive != null)
1
if(isFloppyDrive != null)
2
			{
2
			{
3
				try
3
				try
4
				{
4
				{
5
					return Boolean.TRUE.equals(isDrive.
5
					return Boolean.TRUE.equals(isFloppyDrive.
6
						invoke(fsView, new Object[] { file }));
6
						invoke(fsView, new Object[] { file }));
7
				}
7
				}
8
				catch(Exception e)
8
				catch(Exception e)
9
				{
9
				{
10
					Log.log(Log.ERROR,this,e);
10
					Log.log(Log.ERROR,this,e);
11
					return false;
11
					return false;
12
				}
12
				}
13
			}
13
			}
14
			else
14
			else
15
				return true;
15
				return path.startsWith("A:") || path.startsWith("B:");
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)1.4
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (isDrive != null)
    1
    if (isDrive != null)
    1
    if (isFloppyDrive != null)
    Differences
    Expression1Expression2Difference
    isDriveisFloppyDriveVARIABLE_NAME_MISMATCH
    1
    if (isFloppyDrive != null)
    2
    try
    2
    try
    3
    return Boolean.TRUE.equals(isDrive.invoke(fsView, new Object[] {file}));
    3
    return Boolean.TRUE.equals(isDrive.invoke(fsView, new Object[] {file}));
    3
    return Boolean.TRUE.equals(isFloppyDrive.invoke(fsView, new Object[] {file}));
    Differences
    Expression1Expression2Difference
    isDriveisFloppyDriveVARIABLE_NAME_MISMATCH
    3
    return Boolean.TRUE.equals(isFloppyDrive.invoke(fsView, new Object[] {file}));
    else
    else
    4
    return true;
    4
    return true;
    4
    return path.startsWith("A:") || path.startsWith("B:");
    Differences
    Expression1Expression2Difference
    truepath.startsWith("A:") || path.startsWith("B:")TYPE_COMPATIBLE_REPLACEMENT
    4
    return path.startsWith("A:") || path.startsWith("B:");
    Precondition Violations (0)
    Row Violation