final SyntaxStyle style = _list.getSelectedSyntaxStyle(); final int origRGB = style.getBackgroundRGB(); final Color color = JColorChooser.showDialog(null, //i18n[syntax.selColor2=Select Color] s_stringMgr.getString("syntax.selColor2"), new Color(origRGB)); if (color != null) { style.setBackgroundRGB(color.getRGB()); }
final SyntaxStyle style = _list.getSelectedSyntaxStyle(); final int origRGB = style.getTextRGB(); final Color color = JColorChooser.showDialog(null, //i18n[syntax.selColor=Select Color] s_stringMgr.getString("syntax.selColor"), new Color(origRGB)); if (color != null) { style.setTextRGB(color.getRGB()); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/prefspanel/StyleMaintenancePanel.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/prefspanel/StyleMaintenancePanel.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 5 Number of AST nodes: 5
1
final SyntaxStyle style = _list.getSelectedSyntaxStyle();
1
final SyntaxStyle style = _list.getSelectedSyntaxStyle();
2
			final int origRGB = style.getBackgroundRGB();
2
			final int origRGB = style.getTextRGB();
3
			final Color color = JColorChooser.showDialog(null,
3
			final Color color = JColorChooser.showDialog(null,
4
				//i18n[syntax.selColor2=Select Color]
4
				//i18n[syntax.selColor=Select Color]
5
												s_stringMgr.getString("syntax.selColor2"), new Color(origRGB));
5
												s_stringMgr.getString("syntax.selColor"), new Color(origRGB));
6
			if (color != null)
6
			if (color != null)
7
			{
7
			{
8
				style.setBackgroundRGB(color.getRGB());
8
				style.setTextRGB(color.getRGB());
9
			}
9
			}
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 the same java file
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final SyntaxStyle style = _list.getSelectedSyntaxStyle();
    1
    final SyntaxStyle style = _list.getSelectedSyntaxStyle();
    2
    final int origRGB = style.getBackgroundRGB();
    2
    final int origRGB = style.getBackgroundRGB();
    2
    final int origRGB = style.getTextRGB();
    Differences
    Expression1Expression2Difference
    getBackgroundRGBgetTextRGBMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression style.getBackgroundRGB() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression style.getTextRGB() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    final int origRGB = style.getTextRGB();
    3
    final Color color = JColorChooser.showDialog(null, s_stringMgr.getString("syntax.selColor2"), new Color(origRGB));
    3
    final Color color = JColorChooser.showDialog(null, s_stringMgr.getString("syntax.selColor2"), new Color(origRGB));
    3
    final Color color = JColorChooser.showDialog(null, s_stringMgr.getString("syntax.selColor"), new Color(origRGB));
    Differences
    Expression1Expression2Difference
    "syntax.selColor2""syntax.selColor"LITERAL_VALUE_MISMATCH
    3
    final Color color = JColorChooser.showDialog(null, s_stringMgr.getString("syntax.selColor"), new Color(origRGB));
    4
    if (color != null)
    4
    if (color != null)
    5
    style.setBackgroundRGB(color.getRGB());
    5
    style.setBackgroundRGB(color.getRGB());
    5
    style.setTextRGB(color.getRGB());
    Differences
    Expression1Expression2Difference
    setBackgroundRGBsetTextRGBMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression style.setBackgroundRGB(color.getRGB()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression style.setTextRGB(color.getRGB()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression style.setBackgroundRGB(color.getRGB()) is a void method call, and thus it cannot be parameterized
    Expression style.setTextRGB(color.getRGB()) is a void method call, and thus it cannot be parameterized
    5
    style.setTextRGB(color.getRGB());
    Precondition Violations (6)
    Row Violation
    1Expression style.getBackgroundRGB() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression style.getTextRGB() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression style.setBackgroundRGB(color.getRGB()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression style.setTextRGB(color.getRGB()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression style.setBackgroundRGB(color.getRGB()) is a void method call, and thus it cannot be parameterized
    6Expression style.setTextRGB(color.getRGB()) is a void method call, and thus it cannot be parameterized