storage.remove(uuid); try { IComponentInfo result = storage.get(uuid); } catch (StoreException e) { // that is the expected case return; } catch (Exception e) { fail("Expected a StoreException, not " + e.getMessage()); } fail("Expected a StoreException");
storage.remove(uuid); try { Document result = storage.load(uuid); } catch (StoreException e) { // this is the expected cases return; } catch (Exception e) { fail("Expected StoreException, not " + e.getMessage()); } fail("Expected StoreException, got no exception");
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/store/LocalCalendarStoreTest.java File path: /columba-1.4-src/calendar/src/test/java/org/columba/calendar/store/LocalXMLFileStoreTest.java
Method name: void testRemove() Method name: void testRemove()
Number of AST nodes: 4 Number of AST nodes: 4
1
storage.remove(uuid);
1
storage.remove(uuid);
2
		try {
2
		try {
3
			IComponentInfo result = storage.get(uuid);
3
			Document result = storage.load(uuid);
4
		} catch (StoreException e) {
4
		} catch (StoreException e) {
5
			// that is the expected case
5
			// this is the expected cases
6
			return;
6
			return;
7
		} catch (Exception e) {
7
		} catch (Exception e) {
8
			fail("Expected a StoreException, not " + e.getMessage());
8
			fail("Expected StoreException, not " + e.getMessage());
9
		}
9
		}
10
		
11
		fail("Expected a StoreException");
10
		fail("Expected StoreException, got no exception");
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.4
Clones locationClones are in different classes having the same super 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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    storage.remove(uuid);
    7
    storage.remove(uuid);
    4
    storage.remove(uuid);
    Differences
    Expression1Expression2Difference
    org.columba.calendar.store.LocalCalendarStoreorg.columba.calendar.store.LocalXMLFileStoreVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.calendar.store.LocalCalendarStore of variable storage does not match with type org.columba.calendar.store.LocalXMLFileStore of variable storage
    • Make classes org.columba.calendar.store.LocalCalendarStore and org.columba.calendar.store.LocalXMLFileStore extend a common superclass
    4
    storage.remove(uuid);
    8
    try
    8
    try
    5
    try
    Differences
    Expression1Expression2Difference
    "Expected a StoreException, not ""Expected StoreException, not "LITERAL_VALUE_MISMATCH
    5
    try
                                                                                
    6
    Document result = storage.load(uuid);
    Preondition Violations
    Unmatched statement Document result=storage.load(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    6
    Document result = storage.load(uuid);
    9
    IComponentInfo result = storage.get(uuid);
    9
    IComponentInfo result = storage.get(uuid);
    Preondition Violations
    Unmatched statement IComponentInfo result=storage.get(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                          
    10
    fail("Expected a StoreException");
    10
    fail("Expected a StoreException");
    7
    fail("Expected StoreException, got no exception");
    Differences
    Expression1Expression2Difference
    "Expected a StoreException""Expected StoreException, got no exception"LITERAL_VALUE_MISMATCH
    7
    fail("Expected StoreException, got no exception");
    Precondition Violations (3)
    Row Violation
    1Type org.columba.calendar.store.LocalCalendarStore of variable storage does not match with type org.columba.calendar.store.LocalXMLFileStore of variable storage
    2Unmatched statement Document result=storage.load(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3Unmatched statement IComponentInfo result=storage.get(uuid); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted