FontChooserPanel panel = new FontChooserPanel(this.labelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.labelFont = panel.getSelectedFont(); this.labelFontField.setText( this.labelFont.getFontName() + " " + this.labelFont.getSize() ); }
FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.tickLabelFont = panel.getSelectedFont(); this.tickLabelFontField.setText( this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize() ); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultAxisEditor.java File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultAxisEditor.java
Method name: void attemptLabelFontSelection() Method name: void attemptTickLabelFontSelection()
Number of AST nodes: 5 Number of AST nodes: 5
1
FontChooserPanel panel = new FontChooserPanel(this.labelFont);
1
FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
2
        int result = JOptionPane.showConfirmDialog(this, panel,
2
        int result = JOptionPane.showConfirmDialog(this, panel,
3
            localizationResources.getString("Font_Selection"),
3
            localizationResources.getString("Font_Selection"),
4
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
4
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
5
        if (result == JOptionPane.OK_OPTION) {
5
        if (result == JOptionPane.OK_OPTION) {
6
            this.labelFont = panel.getSelectedFont();
6
            this.tickLabelFont = panel.getSelectedFont();
7
            this.labelFontField.setText(
7
            this.tickLabelFontField.setText(
8
                this.labelFont.getFontName() + " "
8
                this.tickLabelFont.getFontName() + " "
9
 + this.labelFont.getSize()
9
                + this.tickLabelFont.getSize()
10
            );
10
            );
11
        }
11
        }
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.1
Clones locationClones are declared in the same class
Number of node comparisons11
  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)2.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    FontChooserPanel panel = new FontChooserPanel(this.labelFont);
    1
    FontChooserPanel panel = new FontChooserPanel(this.labelFont);
    1
    FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
    Differences
    Expression1Expression2Difference
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    1
    FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
    2
    int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    2
    int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    3
    if (result == JOptionPane.OK_OPTION)
    3
    if (result == JOptionPane.OK_OPTION)
    4
    this.labelFont = panel.getSelectedFont();
    4
    this.labelFont = panel.getSelectedFont();
    4
    this.tickLabelFont = panel.getSelectedFont();
    Differences
    Expression1Expression2Difference
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.labelFont is a field being modified, and thus it cannot be parameterized
    Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized
    4
    this.tickLabelFont = panel.getSelectedFont();
    5
    this.labelFontField.setText(this.labelFont.getFontName() + " " + this.labelFont.getSize());
    5
    this.labelFontField.setText(this.labelFont.getFontName() + " " + this.labelFont.getSize());
    5
    this.tickLabelFontField.setText(this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize());
    Differences
    Expression1Expression2Difference
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    labelFonttickLabelFontVARIABLE_NAME_MISMATCH
    labelFontFieldtickLabelFontFieldVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.tickLabelFontField.setText(this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize());
    Precondition Violations (6)
    Row Violation
    1Expression this.labelFont is a field being modified, and thus it cannot be parameterized
    2Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized
    3Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.labelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted