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