if ( jabberId == null ) throw new IllegalArgumentException("jabberId == null"); if (chatMap.containsKey(jabberId)) return true; return false;
if ( menuId == null ) throw new IllegalArgumentException("menuId == null"); if ( map.containsKey(menuId)) return true; return false;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/plugins/org.columba.chat.altura/src/org/columba/chat/ui/conversation/ConversationController.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/menu/ExtendableMenuBar.java
Method name: boolean exists(String) Method name: boolean exists(String)
Number of AST nodes: 5 Number of AST nodes: 5
1
if ( jabberId == null ) throw new IllegalArgumentException("jabberId == null");
1
if ( menuId == null ) throw new IllegalArgumentException("menuId == null");
2
		
2
		
3
		if (chatMap.containsKey(jabberId))
3
		if ( map.containsKey(
4
			return true;
4
menuId)) return true;
5
		
5
		return false;
6
		return false;
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 comparisons11
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (jabberId == null)
    1
    if (jabberId == null)
    1
    if (menuId == null)
    Differences
    Expression1Expression2Difference
    jabberIdmenuIdVARIABLE_NAME_MISMATCH
    1
    if (menuId == null)
    2
    throw new IllegalArgumentException("jabberId == null");
    2
    throw new IllegalArgumentException("jabberId == null");
    2
    throw new IllegalArgumentException("menuId == null");
    Differences
    Expression1Expression2Difference
    "jabberId == null""menuId == null"LITERAL_VALUE_MISMATCH
    2
    throw new IllegalArgumentException("menuId == null");
    3
    if (chatMap.containsKey(jabberId))
    3
    if (chatMap.containsKey(jabberId))
    3
    if (map.containsKey(menuId))
    Differences
    Expression1Expression2Difference
    jabberIdmenuIdVARIABLE_NAME_MISMATCH
    chatMapmapVARIABLE_NAME_MISMATCH
    java.util.Mapjava.util.HashtableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Map<java.lang.String,org.columba.chat.ui.conversation.api.IChatMediator> of variable chatMap does not match with type java.util.Hashtable<java.lang.String,org.columba.core.gui.menu.ExtendableMenu> of variable map
    • Make classes java.util.Map and java.util.Hashtable extend a common superclass
    3
    if (map.containsKey(menuId))
    4
    return true;
    4
    return true;
    5
    return false;
    5
    return false;
    Precondition Violations (2)
    Row Violation
    1Type java.util.Map<java.lang.String,org.columba.chat.ui.conversation.api.IChatMediator> of variable chatMap does not match with type java.util.Hashtable<java.lang.String,org.columba.core.gui.menu.ExtendableMenu> of variable map
    2The refactoring of the clones is infeasible, because classes org.columba.chat.ui.conversation.ConversationController and org.columba.core.gui.menu.ExtendableMenuBar do not have a common superclass