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() ); }
FontChooserPanel panel = new FontChooserPanel(this.titleFont); int result = JOptionPane.showConfirmDialog( this, panel, localizationResources.getString("Font_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE ); if (result == JOptionPane.OK_OPTION) { this.titleFont = panel.getSelectedFont(); this.fontfield.setText( this.titleFont.getFontName() + " " + this.titleFont.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/DefaultTitleEditor.java
Method name: void attemptTickLabelFontSelection() Method name: void attemptFontSelection()
Number of AST nodes: 5 Number of AST nodes: 5
1
FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
1
FontChooserPanel panel = new FontChooserPanel(this.titleFont);
2
        int result = 
2
        int result = 
3
JOptionPane.showConfirmDialog(this, panel,
3
            JOptionPane.showConfirmDialog(
4
            localizationResources.getString("Font_Selection"),
4
                this, panel, localizationResources.getString("Font_Selection"),
5
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
5
                JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
6
);
6
            );
7
        if (result == JOptionPane.OK_OPTION) {
7
        if (result == JOptionPane.OK_OPTION) {
8
            this.tickLabelFont = panel.getSelectedFont();
8
            this.titleFont = panel.getSelectedFont();
9
            this.tickLabelFontField.setText(
9
            this.fontfield.setText(
10
                this.tickLabelFont.getFontName() + " "
10
                this.titleFont.getFontName() + " "
11
                + this.tickLabelFont.getSize()
11
 + this.titleFont.getSize()
12
            );
12
            );
13
        }
13
        }
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 different classes having the same super 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)3.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
    1
    FontChooserPanel panel = new FontChooserPanel(this.tickLabelFont);
    1
    FontChooserPanel panel = new FontChooserPanel(this.titleFont);
    Differences
    Expression1Expression2Difference
    tickLabelFonttitleFontVARIABLE_NAME_MISMATCH
    1
    FontChooserPanel panel = new FontChooserPanel(this.titleFont);
    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.tickLabelFont = panel.getSelectedFont();
    4
    this.tickLabelFont = panel.getSelectedFont();
    4
    this.titleFont = panel.getSelectedFont();
    Differences
    Expression1Expression2Difference
    tickLabelFonttitleFontVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized
    Expression this.titleFont is a field being modified, and thus it cannot be parameterized
    4
    this.titleFont = panel.getSelectedFont();
    5
    this.tickLabelFontField.setText(this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize());
    5
    this.tickLabelFontField.setText(this.tickLabelFont.getFontName() + " " + this.tickLabelFont.getSize());
    5
    this.fontfield.setText(this.titleFont.getFontName() + " " + this.titleFont.getSize());
    Differences
    Expression1Expression2Difference
    tickLabelFonttitleFontVARIABLE_NAME_MISMATCH
    tickLabelFonttitleFontVARIABLE_NAME_MISMATCH
    tickLabelFontFieldfontfieldVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.titleFont 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.titleFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.fontfield.setText(this.titleFont.getFontName() + " " + this.titleFont.getSize());
    Precondition Violations (6)
    Row Violation
    1Expression this.tickLabelFont is a field being modified, and thus it cannot be parameterized
    2Expression this.titleFont is a field being modified, and thus it cannot be parameterized
    3Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.titleFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.tickLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.titleFont cannot be parameterized, because it has dependencies to/from statements that will be extracted