try { restore(); } catch (IOException e) { // Never mind }
while (!tryToGetLock(theLocker)) { try { wait(); } catch (InterruptedException e) { // nothing to do } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/io/StreamCache.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/base/Lock.java
Method name: void StreamCache(File, long) Method name: void getLock(Object)
Number of AST nodes: 2 Number of AST nodes: 3
1
try {
2
				restore
1
while (!tryToGetLock(theLocker)) {
2
	    try {
3
();
3
		wait();
4
			} catch (IOException e) {
4
	    } catch (InterruptedException e) {
5
				// Never mind
5
		// 
6
		
6
nothing to do
7
	    }
7
	}
8
	}
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.2
Clones locationClones are in different classes
Number of node comparisons4
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    7
    try
    Differences
    Expression1Expression2Difference
    java.io.IOExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    java.io.IOExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    7
    try
    6
    restore();
    6
    restore();
    8
    wait();
    Differences
    Expression1Expression2Difference
    restorewaitMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression restore() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression wait() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression restore() is a void method call, and thus it cannot be parameterized
    Expression wait() is a void method call, and thus it cannot be parameterized
    8
    wait();
    Precondition Violations (4)
    Row Violation
    1Expression restore() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression wait() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression restore() is a void method call, and thus it cannot be parameterized
    4Expression wait() is a void method call, and thus it cannot be parameterized