StrokeChooserPanel panel = new StrokeChooserPanel( null, this.availableStrokeSamples ); int result = JOptionPane.showConfirmDialog( this, panel, localizationResources.getString("Stroke_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE ); if (result == JOptionPane.OK_OPTION) { this.gridStrokeSample.setStroke(panel.getSelectedStroke()); }
StrokeChooserPanel panel = new StrokeChooserPanel(null, this.availableStrokeSamples); int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Stroke_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { this.outlineStrokeSample.setStroke(panel.getSelectedStroke()); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultNumberAxisEditor.java File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java
Method name: void attemptGridStrokeSelection() Method name: void attemptOutlineStrokeSelection()
Number of AST nodes: 4 Number of AST nodes: 4
1
StrokeChooserPanel panel 
1
StrokeChooserPanel panel 
2
= new StrokeChooserPanel(
2
            = new StrokeChooserPanel(
3
            null, this.availableStrokeSamples
3
null, this.availableStrokeSamples
4
        );
4
);
5
        int result = JOptionPane.showConfirmDialog(
5
        int result = JOptionPane.showConfirmDialog(this, panel,
6
            this, panel, localizationResources.getString("Stroke_Selection"),
6
            localizationResources.getString("Stroke_Selection"),
7
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
7
            JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE
8
        );
8
);
9
        if (result == JOptionPane.OK_OPTION) {
9
        if (result == JOptionPane.OK_OPTION) {
10
            this.gridStrokeSample.setStroke(panel.getSelectedStroke());
10
            this.outlineStrokeSample.setStroke(panel.getSelectedStroke());
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 in different classes having the same super class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    StrokeChooserPanel panel = new StrokeChooserPanel(null, this.availableStrokeSamples);
    1
    StrokeChooserPanel panel = new StrokeChooserPanel(null, this.availableStrokeSamples);
    2
    int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Stroke_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    2
    int result = JOptionPane.showConfirmDialog(this, panel, localizationResources.getString("Stroke_Selection"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    3
    if (result == JOptionPane.OK_OPTION)
    3
    if (result == JOptionPane.OK_OPTION)
    4
    this.gridStrokeSample.setStroke(panel.getSelectedStroke());
    4
    this.gridStrokeSample.setStroke(panel.getSelectedStroke());
    4
    this.outlineStrokeSample.setStroke(panel.getSelectedStroke());
    Differences
    Expression1Expression2Difference
    gridStrokeSampleoutlineStrokeSampleVARIABLE_NAME_MISMATCH
    4
    this.outlineStrokeSample.setStroke(panel.getSelectedStroke());
    Precondition Violations (1)
    Row Violation
    1The refactoring of the clones is infeasible, because classes org.jfree.chart.editor.DefaultNumberAxisEditor and org.jfree.chart.editor.DefaultPlotEditor do not have a common superclass