statusBarBackgroundColorBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor; Color newColor = JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor); if (newColor != null) { statusBarBackgroundColor = newColor; statusBarBackgroundColorPnl.setBackground(newColor); statusBarBackgroundColorPnl.validate(); } } });
objectTreeBackgroundColorBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Color startColor = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor; Color newColor = JColorChooser.showDialog(null, i18n.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor); if (newColor != null) { objectTreeBackgroundColor = newColor; objectTreeBackgroundColorPnl.setBackground(newColor); objectTreeBackgroundColorPnl.validate(); } } });
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/ColorPropertiesPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/aliasproperties/ColorPropertiesPanel.java
Method name: void addStatusBarColorComponents(GridBagConstraints) Method name: void addObjectTreeColorComponents(GridBagConstraints)
Number of AST nodes: 1 Number of AST nodes: 1
1
statusBarBackgroundColorBtn.addActionListener(new ActionListener()
1
objectTreeBackgroundColorBtn.addActionListener(new ActionListener()
2
		{
2
		{
3
			@Override
3
			@Override
4
			public void actionPerformed(ActionEvent e)
4
			public void actionPerformed(ActionEvent e)
5
			{
5
			{
6
				Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor;
6
				Color startColor = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor;
7
				Color newColor =
7
				Color newColor =
8
					JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,
8
					JColorChooser.showDialog(null, i18n.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,
9
						startColor);
9
						startColor);
10
				if (newColor != null)
10
				if (newColor != null)
11
				{
11
				{
12
					statusBarBackgroundColor = newColor;
12
					objectTreeBackgroundColor = newColor;
13
					statusBarBackgroundColorPnl.setBackground(newColor);
13
					objectTreeBackgroundColorPnl.setBackground(newColor);
14
					statusBarBackgroundColorPnl.validate();
14
					objectTreeBackgroundColorPnl.validate();
15
				}
15
				}
16
			}
16
			}
17
		});
17
		});
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.0
Clones locationClones are declared in the same class
Number of node comparisons1
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements1
    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
    20
    statusBarBackgroundColorBtn.addActionListener(new ActionListener() {...});
    20
    statusBarBackgroundColorBtn.addActionListener(new ActionListener() {...});
    20
    objectTreeBackgroundColorBtn.addActionListener(new ActionListener() {...});
    Differences
    Expression1Expression2Difference
    statusBarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    statusBarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLEOBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLEVARIABLE_NAME_MISMATCH
    statusBarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    statusBarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    statusBarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    statusBarBackgroundColorBtnobjectTreeBackgroundColorBtnVARIABLE_NAME_MISMATCH
    20
    objectTreeBackgroundColorBtn.addActionListener(new ActionListener() {...});
    Precondition Violations (0)
    Row Violation