String canonPath; try { canonPath = file.getCanonicalPath(); } catch(IOException io) { canonPath = path; } boolean retVal = file.delete();
String canonPath; try { canonPath = file.getCanonicalPath(); } catch(IOException io) { canonPath = directory; } VFSManager.sendVFSUpdate(this,canonPath,true);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileVFS.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/io/FileVFS.java
Method name: boolean _delete(Object, String, Component) Method name: boolean _mkdir(Object, String, Component)
Number of AST nodes: 4 Number of AST nodes: 4
1
String canonPath;
1
String canonPath;
2
		try
2
		try
3
		{
3
		{
4
			canonPath = file.getCanonicalPath();
4
			canonPath = file.getCanonicalPath();
5
		}
5
		}
6
		catch(IOException io)
6
		catch(IOException io)
7
		{
7
		{
8
			canonPath = path;
8
			canonPath = directory;
9
		}
9
		}
10
		boolean retVal = file.delete();
10
		VFSManager.sendVFSUpdate(this,canonPath,true);
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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    String canonPath;
    7
    String canonPath;
    3
    try
    3
    try
    8
    try
    Differences
    Expression1Expression2Difference
    pathdirectoryVARIABLE_NAME_MISMATCH
    8
    try
    4
    canonPath = file.getCanonicalPath();
    9
    canonPath = file.getCanonicalPath();
    5
    boolean retVal = file.delete();
    5
    boolean retVal = file.delete();
    Preondition Violations
    Unmatched statement boolean retVal=file.delete(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                    
                                                                                                        
    10
    VFSManager.sendVFSUpdate(this, canonPath, true);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement boolean retVal=file.delete(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted