ColorItem color = (ColorItem) value; setText(color.getName()); setIcon(color.getIcon());
if (value instanceof ISearchProvider) { ISearchProvider p = (ISearchProvider) value; setText(p.getName()); setIcon(p.getIcon()); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/base/ColorItemRenderer.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/SearchBar.java
Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean) Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean)
Number of AST nodes: 3 Number of AST nodes: 4
1
ColorItem color = (ColorItem) value;
2
            
1
if (value instanceof ISearchProvider) {
2
				ISearchProvider p = (ISearchProvider) value;
3
setText(color.getName());
3
				setText(p.getName());
4
            setIcon(color.getIcon());
4
				setIcon(p.getIcon());
5
			}
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    ColorItem color = (ColorItem)value;
                                                                            
                                                                                            
    3
    ISearchProvider p = (ISearchProvider)value;
    3
    setText(color.getName());
    3
    setText(color.getName());
    4
    setText(p.getName());
    Differences
    Expression1Expression2Difference
    colorpVARIABLE_NAME_MISMATCH
    org.columba.core.gui.base.ColorItemorg.columba.core.search.api.ISearchProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.gui.base.ColorItem of variable color does not match with type org.columba.core.search.api.ISearchProvider of variable p
    • Make classes org.columba.core.gui.base.ColorItem and org.columba.core.search.api.ISearchProvider extend a common superclass
    4
    setText(p.getName());
    4
    setIcon(color.getIcon());
    4
    setIcon(color.getIcon());
    5
    setIcon(p.getIcon());
    Differences
    Expression1Expression2Difference
    colorpVARIABLE_NAME_MISMATCH
    org.columba.core.gui.base.ColorItemorg.columba.core.search.api.ISearchProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.gui.base.ColorItem of variable color does not match with type org.columba.core.search.api.ISearchProvider of variable p
    • Make classes org.columba.core.gui.base.ColorItem and org.columba.core.search.api.ISearchProvider extend a common superclass
    5
    setIcon(p.getIcon());
    Precondition Violations (3)
    Row Violation
    1Type org.columba.core.gui.base.ColorItem of variable color does not match with type org.columba.core.search.api.ISearchProvider of variable p
    2Type org.columba.core.gui.base.ColorItem of variable color does not match with type org.columba.core.search.api.ISearchProvider of variable p
    3The refactoring of the clones is infeasible, because classes org.columba.core.gui.base.ColorItemRenderer and org.columba.core.gui.search.SearchBar.MyComboBoxRenderer do not have a common superclass