if (cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setBorder((cellHasFocus) ? UIManager .getBorder("List.focusCellHighlightBorder") : noFocusBorder); // id = org.columba.example.HelloWorld$HelloWorldPlugin String id = (String) value; //String userVisibleName = pluginHandler.getUserVisibleName(id); String userVisibleName = id; setText(userVisibleName); return this;
if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setBorder((cellHasFocus) ? UIManager .getBorder("List.focusCellHighlightBorder") : noFocusBorder); // id = org.columba.example.HelloWorld$HelloWorldPlugin String id = (String) value; // String userVisibleName = pluginHandler.getUserVisibleName(id); String userVisibleName = id; setText(userVisibleName); return this;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/util/ActionComboBoxRenderer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/util/CriteriaComboBoxRenderer.java
Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean) Method name: Component getListCellRendererComponent(JList, Object, int, boolean, boolean)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (cellHasFocus) {
1
if (isSelected) {
2
			setBackground(list.getSelectionBackground());
2
			setBackground(list.getSelectionBackground());
3
			setForeground(list.getSelectionForeground());
3
			setForeground(list.getSelectionForeground());
4
		} else {
4
		} else {
5
			setBackground(list.getBackground());
5
			setBackground(list.getBackground());
6
			setForeground(list.getForeground());
6
			setForeground(list.getForeground());
7
		}
7
		}
8
		setBorder((cellHasFocus) ? UIManager
8
		setBorder((cellHasFocus) ? UIManager
9
				.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
9
				.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
10
		// id = org.columba.example.HelloWorld$HelloWorldPlugin
10
		// id = org.columba.example.HelloWorld$HelloWorldPlugin
11
		String id = (String) value;
11
		String id = (String) value;
12
		//String userVisibleName = pluginHandler.getUserVisibleName(id);
12
		// String userVisibleName = pluginHandler.getUserVisibleName(id);
13
		String userVisibleName = id;
13
		String userVisibleName = id;
14
		setText(userVisibleName);
14
		setText(userVisibleName);
15
		return this;
15
		return this;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (cellHasFocus)
    1
    if (cellHasFocus)
    1
    if (isSelected)
    Differences
    Expression1Expression2Difference
    cellHasFocusisSelectedVARIABLE_NAME_MISMATCH
    1
    if (isSelected)
    2
    setBackground(list.getSelectionBackground());
    2
    setBackground(list.getSelectionBackground());
    3
    setForeground(list.getSelectionForeground());
    3
    setForeground(list.getSelectionForeground());
    else
    else
    4
    setBackground(list.getBackground());
    4
    setBackground(list.getBackground());
    5
    setForeground(list.getForeground());
    5
    setForeground(list.getForeground());
    6
    setBorder((cellHasFocus) ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
    6
    setBorder((cellHasFocus) ? UIManager.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
    7
    String id = (String)value;
    7
    String id = (String)value;
    8
    String userVisibleName = id;
    8
    String userVisibleName = id;
    9
    setText(userVisibleName);
    9
    setText(userVisibleName);
    10
    return this;
    10
    return this;
    Precondition Violations (0)
    Row Violation