FontSelectionDialog fontDialog = new FontSelectionDialog(this, null); if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION) { mainFont = fontDialog.getSelectedFont(); mainFontButton.setFont(mainFont); mainFontButton.setText(mainFont.getFontName()); }
FontSelectionDialog fontDialog = new FontSelectionDialog(this, null); if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION) { textFont = fontDialog.getSelectedFont(); textFontButton.setFont(textFont); textFontButton.setText(textFont.getFontName()); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/config/GeneralOptionsDialog.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/config/GeneralOptionsDialog.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 5 Number of AST nodes: 5
1
FontSelectionDialog fontDialog = new FontSelectionDialog(this, null);
1
FontSelectionDialog fontDialog = new FontSelectionDialog(this, null);
2
			if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION) {
2
			if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION) {
3
				mainFont = fontDialog.getSelectedFont();
3
				textFont = fontDialog.getSelectedFont();
4
				mainFontButton.setFont(mainFont);
4
				textFontButton.setFont(textFont);
5
				mainFontButton.setText(mainFont.getFontName());
5
				textFontButton.setText(textFont.getFontName());
6
			}
6
			}
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 method
Number of node comparisons18
  1. {Non-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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    26
    FontSelectionDialog fontDialog = new FontSelectionDialog(this, null);
    32
    FontSelectionDialog fontDialog = new FontSelectionDialog(this, null);
    27
    if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION)
    33
    if (fontDialog.showDialog() == FontSelectionDialog.APPROVE_OPTION)
    28
    mainFont = fontDialog.getSelectedFont();
    28
    mainFont = fontDialog.getSelectedFont();
    34
    textFont = fontDialog.getSelectedFont();
    Differences
    Expression1Expression2Difference
    mainFonttextFontVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mainFont is a field being modified, and thus it cannot be parameterized
    Expression textFont is a field being modified, and thus it cannot be parameterized
    34
    textFont = fontDialog.getSelectedFont();
    29
    mainFontButton.setFont(mainFont);
    29
    mainFontButton.setFont(mainFont);
    35
    textFontButton.setFont(textFont);
    Differences
    Expression1Expression2Difference
    mainFonttextFontVARIABLE_NAME_MISMATCH
    mainFontButtontextFontButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mainFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression textFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35
    textFontButton.setFont(textFont);
    30
    mainFontButton.setText(mainFont.getFontName());
    30
    mainFontButton.setText(mainFont.getFontName());
    36
    textFontButton.setText(textFont.getFontName());
    Differences
    Expression1Expression2Difference
    mainFonttextFontVARIABLE_NAME_MISMATCH
    mainFontButtontextFontButtonVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression mainFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression textFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    36
    textFontButton.setText(textFont.getFontName());
    Precondition Violations (6)
    Row Violation
    1Expression mainFont is a field being modified, and thus it cannot be parameterized
    2Expression textFont is a field being modified, and thus it cannot be parameterized
    3Expression mainFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression textFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression mainFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression textFont cannot be parameterized, because it has dependencies to/from statements that will be extracted