Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor; Color newColor = JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor); if (newColor != null) { toolbarBackgroundColor = newColor; toolbarBackgroundColorPnl.setBackground(newColor); toolbarBackgroundColorPnl.validate(); }
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(); }
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 actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 6 Number of AST nodes: 6
1
Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor;
1
Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor;
2
				Color newColor =
2
				Color newColor =
3
					JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, 
3
					JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,
4
startColor);
4
						startColor);
5
				if (newColor != null)
5
				if (newColor != null)
6
				{
6
				{
7
					toolbarBackgroundColor = newColor;
7
					statusBarBackgroundColor = newColor;
8
					toolbarBackgroundColorPnl.setBackground(newColor);
8
					statusBarBackgroundColorPnl.setBackground(newColor);
9
					toolbarBackgroundColorPnl.validate();
9
					statusBarBackgroundColorPnl.validate();
10
				}
10
				}
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.2
Clones locationClones are in the same java file
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor;
    1
    Color startColor = toolbarBackgroundColor == null ? Color.WHITE : toolbarBackgroundColor;
    1
    Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor;
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorstatusBarBackgroundColorVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorstatusBarBackgroundColorVARIABLE_NAME_MISMATCH
    1
    Color startColor = statusBarBackgroundColor == null ? Color.WHITE : statusBarBackgroundColor;
    2
    Color newColor = JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    2
    Color newColor = JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    2
    Color newColor = JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    Differences
    Expression1Expression2Difference
    TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLESTATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLEVARIABLE_NAME_MISMATCH
    2
    Color newColor = JColorChooser.showDialog(null, i18n.STATUS_BAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    3
    if (newColor != null)
    3
    if (newColor != null)
    3
    if (newColor != null)
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorstatusBarBackgroundColorVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorPnlstatusBarBackgroundColorPnlVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorPnlstatusBarBackgroundColorPnlVARIABLE_NAME_MISMATCH
    3
    if (newColor != null)
    4
    toolbarBackgroundColor = newColor;
    4
    toolbarBackgroundColor = newColor;
    4
    statusBarBackgroundColor = newColor;
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorstatusBarBackgroundColorVARIABLE_NAME_MISMATCH
    4
    statusBarBackgroundColor = newColor;
    5
    toolbarBackgroundColorPnl.setBackground(newColor);
    5
    toolbarBackgroundColorPnl.setBackground(newColor);
    5
    statusBarBackgroundColorPnl.setBackground(newColor);
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorPnlstatusBarBackgroundColorPnlVARIABLE_NAME_MISMATCH
    5
    statusBarBackgroundColorPnl.setBackground(newColor);
    6
    toolbarBackgroundColorPnl.validate();
    6
    toolbarBackgroundColorPnl.validate();
    6
    statusBarBackgroundColorPnl.validate();
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorPnlstatusBarBackgroundColorPnlVARIABLE_NAME_MISMATCH
    6
    statusBarBackgroundColorPnl.validate();
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes and do not have a common superclass