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 = 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 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 = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor;
2
				Color newColor =
2
				Color newColor =
3
					JColorChooser.showDialog(null, i18n.TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, 
3
					JColorChooser.showDialog(null, i18n.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE,
4
startColor);
4
						startColor);
5
				if (newColor != null)
5
				if (newColor != null)
6
				{
6
				{
7
					toolbarBackgroundColor = newColor;
7
					objectTreeBackgroundColor = newColor;
8
					toolbarBackgroundColorPnl.setBackground(newColor);
8
					objectTreeBackgroundColorPnl.setBackground(newColor);
9
					toolbarBackgroundColorPnl.validate();
9
					objectTreeBackgroundColorPnl.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.6
    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 = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor;
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    1
    Color startColor = objectTreeBackgroundColor == null ? Color.WHITE : objectTreeBackgroundColor;
    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.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    Differences
    Expression1Expression2Difference
    TOOLBAR_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLEOBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLEVARIABLE_NAME_MISMATCH
    2
    Color newColor = JColorChooser.showDialog(null, i18n.OBJECT_TREE_BACKGROUND_COLOR_CHOOSER_DIALOG_TITLE, startColor);
    3
    if (newColor != null)
    3
    if (newColor != null)
    3
    if (newColor != null)
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    toolbarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    3
    if (newColor != null)
    4
    toolbarBackgroundColor = newColor;
    4
    toolbarBackgroundColor = newColor;
    4
    objectTreeBackgroundColor = newColor;
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorobjectTreeBackgroundColorVARIABLE_NAME_MISMATCH
    4
    objectTreeBackgroundColor = newColor;
    5
    toolbarBackgroundColorPnl.setBackground(newColor);
    5
    toolbarBackgroundColorPnl.setBackground(newColor);
    5
    objectTreeBackgroundColorPnl.setBackground(newColor);
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    5
    objectTreeBackgroundColorPnl.setBackground(newColor);
    6
    toolbarBackgroundColorPnl.validate();
    6
    toolbarBackgroundColorPnl.validate();
    6
    objectTreeBackgroundColorPnl.validate();
    Differences
    Expression1Expression2Difference
    toolbarBackgroundColorPnlobjectTreeBackgroundColorPnlVARIABLE_NAME_MISMATCH
    6
    objectTreeBackgroundColorPnl.validate();
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes and do not have a common superclass