collapsible = new JXCollapsiblePane(); collapsible.add(compBox.getView()); collapsible.setCollapsed(true); Action toggleAction = collapsible.getActionMap().get( JXCollapsiblePane.TOGGLE_ACTION); // use the collapse/expand icons from the JTree UI toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager .getIcon("Tree.expandedIcon")); toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager .getIcon("Tree.collapsedIcon")); link = new JXHyperlink(toggleAction); link.setText(compBox.getName()); link.setToolTipText(compBox.getDescription()); link.setOpaque(true); link.setFocusPainted(false); link.setUnclickedColor(UIManager.getColor("Label.foreground")); link.setClickedColor(UIManager.getColor("Label.foreground"));
collapsible = new JXCollapsiblePane(); // collapsible.getContentPane().setBackground(Color.WHITE); collapsible.add(provider.getView()); collapsible.setCollapsed(true); Action toggleAction = collapsible.getActionMap().get( JXCollapsiblePane.TOGGLE_ACTION); // use the collapse/expand icons from the JTree UI toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager .getIcon("Tree.expandedIcon")); toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager .getIcon("Tree.collapsedIcon")); link = new JXHyperlink(toggleAction); link.setText(provider.getName()); link.setToolTipText(provider.getDescription()); // link.setFont(link.getFont().deriveFont(Font.BOLD)); link.setOpaque(true); // link.setBackground(titleBackground); link.setFocusPainted(false); link.setUnclickedColor(UIManager.getColor("Label.foreground")); link.setClickedColor(UIManager.getColor("Label.foreground"));
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/search/ComponentBoxContainer.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/context/ContextResultBox.java
Method name: void ComponentBoxContainer(IComponentBox) Method name: void ContextResultBox(IFrameMediator, IContextProvider, IContextSearchManager)
Number of AST nodes: 13 Number of AST nodes: 13
1
collapsible = new JXCollapsiblePane();
1
collapsible = new JXCollapsiblePane();
2
		collapsible.add(compBox
2
		// collapsible.getContentPane().setBackground(Color.WHITE);
3
.getView());
3
		collapsible.add(provider.getView());
4
		collapsible.setCollapsed(true);
4
		collapsible.setCollapsed(true);
5
		Action toggleAction = collapsible.getActionMap().get(
5
		Action toggleAction = collapsible.getActionMap().get(
6
				JXCollapsiblePane.TOGGLE_ACTION);
6
				JXCollapsiblePane.TOGGLE_ACTION);
7
		// use the collapse/expand icons from the JTree UI
7
		// use the collapse/expand icons from the JTree UI
8
		toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager
8
		toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager
9
				.getIcon("Tree.expandedIcon"));
9
				.getIcon("Tree.expandedIcon"));
10
		toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager
10
		toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager
11
				.getIcon("Tree.collapsedIcon"));
11
				.getIcon("Tree.collapsedIcon"));
12
		link = new JXHyperlink(toggleAction);
12
		link = new JXHyperlink(toggleAction);
13
		link.setText(compBox.getName());
13
		link.setText(provider.getName());
14
		link.setToolTipText(compBox.getDescription());
14
		link.setToolTipText(provider.getDescription());
15
		link.setOpaque(true
15
		// link.setFont(link.getFont().deriveFont(Font.BOLD));
16
		link.setOpaque(true);
16
);
17
		// link.setBackground(titleBackground);
17
		link.setFocusPainted(false);
18
		link.setFocusPainted(false);
18
		link.setUnclickedColor(UIManager.getColor("Label.foreground"));
19
		link.setUnclickedColor(UIManager.getColor("Label.foreground"));
19
		link.setClickedColor(UIManager.getColor("Label.foreground"));
20
		link.setClickedColor(UIManager.getColor("Label.foreground"));
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 comparisons82
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    collapsible = new JXCollapsiblePane();
    5
    collapsible = new JXCollapsiblePane();
    3
    collapsible.add(compBox.getView());
    3
    collapsible.add(compBox.getView());
    6
    collapsible.add(provider.getView());
    Differences
    Expression1Expression2Difference
    compBoxproviderVARIABLE_NAME_MISMATCH
    org.columba.core.gui.frame.api.IComponentBoxorg.columba.core.context.api.IContextProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider
    • Make classes org.columba.core.gui.frame.api.IComponentBox and org.columba.core.context.api.IContextProvider extend a common superclass
    6
    collapsible.add(provider.getView());
    4
    collapsible.setCollapsed(true);
    7
    collapsible.setCollapsed(true);
    5
    Action toggleAction = collapsible.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION);
    8
    Action toggleAction = collapsible.getActionMap().get(JXCollapsiblePane.TOGGLE_ACTION);
    6
    toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager.getIcon("Tree.expandedIcon"));
    9
    toggleAction.putValue(JXCollapsiblePane.COLLAPSE_ICON, UIManager.getIcon("Tree.expandedIcon"));
    7
    toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager.getIcon("Tree.collapsedIcon"));
    10
    toggleAction.putValue(JXCollapsiblePane.EXPAND_ICON, UIManager.getIcon("Tree.collapsedIcon"));
    8
    link = new JXHyperlink(toggleAction);
    11
    link = new JXHyperlink(toggleAction);
    9
    link.setText(compBox.getName());
    9
    link.setText(compBox.getName());
    12
    link.setText(provider.getName());
    Differences
    Expression1Expression2Difference
    compBoxproviderVARIABLE_NAME_MISMATCH
    org.columba.core.gui.frame.api.IComponentBoxorg.columba.core.context.api.IContextProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider
    • Make classes org.columba.core.gui.frame.api.IComponentBox and org.columba.core.context.api.IContextProvider extend a common superclass
    12
    link.setText(provider.getName());
    10
    link.setToolTipText(compBox.getDescription());
    10
    link.setToolTipText(compBox.getDescription());
    13
    link.setToolTipText(provider.getDescription());
    Differences
    Expression1Expression2Difference
    compBoxproviderVARIABLE_NAME_MISMATCH
    org.columba.core.gui.frame.api.IComponentBoxorg.columba.core.context.api.IContextProviderVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider
    • Make classes org.columba.core.gui.frame.api.IComponentBox and org.columba.core.context.api.IContextProvider extend a common superclass
    13
    link.setToolTipText(provider.getDescription());
    11
    link.setOpaque(true);
    14
    link.setOpaque(true);
    12
    link.setFocusPainted(false);
    15
    link.setFocusPainted(false);
    13
    link.setUnclickedColor(UIManager.getColor("Label.foreground"));
    16
    link.setUnclickedColor(UIManager.getColor("Label.foreground"));
    14
    link.setClickedColor(UIManager.getColor("Label.foreground"));
    17
    link.setClickedColor(UIManager.getColor("Label.foreground"));
    Precondition Violations (3)
    Row Violation
    1Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider
    2Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider
    3Type org.columba.core.gui.frame.api.IComponentBox of variable compBox does not match with type org.columba.core.context.api.IContextProvider of variable provider