if (this.rangeAxisPropertyPanel != null) { Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) { this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis); } }
if (this.rangeAxisPropertyPanel != null) { Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTPlotEditor.java
Method name: void updatePlotProperties(Plot) Method name: void updatePlotProperties(Plot)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (this.rangeAxisPropertyPanel != null) {
1
if (this.rangeAxisPropertyPanel != null) {
2
            Axis rangeAxis = null;
2
            Axis rangeAxis = null;
3
            if (plot instanceof CategoryPlot) {
3
            if (plot instanceof CategoryPlot) {
4
                CategoryPlot p = (CategoryPlot) plot;
4
                CategoryPlot p = (CategoryPlot) plot;
5
                rangeAxis = p.getRangeAxis();
5
                rangeAxis = p.getRangeAxis();
6
            }
6
            }
7
            else if (plot instanceof XYPlot) {
7
            else if (plot instanceof XYPlot) {
8
                XYPlot p = (XYPlot) plot;
8
                XYPlot p = (XYPlot) plot;
9
                rangeAxis = p.getRangeAxis();
9
                rangeAxis = p.getRangeAxis();
10
            }
10
            }
11
            if (rangeAxis != null) {
11
            if (rangeAxis != null)
12
                this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
12
                this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
13
            }
14
        }
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)1.1
Clones locationClones are in different classes
Number of node comparisons40
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    if (this.rangeAxisPropertyPanel != null)
    15
    if (this.rangeAxisPropertyPanel != null)
    14
    if (this.rangeAxisPropertyPanel != null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.editor.DefaultAxisEditororg.jfree.experimental.chart.swt.editor.SWTAxisEditorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.editor.DefaultAxisEditor of variable this.rangeAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel
    • Make classes org.jfree.chart.editor.DefaultAxisEditor and org.jfree.experimental.chart.swt.editor.SWTAxisEditor extend a common superclass
    14
    if (this.rangeAxisPropertyPanel != null)
    16
    Axis rangeAxis = null;
    15
    Axis rangeAxis = null;
    17
    if (plot instanceof CategoryPlot)
    16
    if (plot instanceof CategoryPlot)
    18
    CategoryPlot p = (CategoryPlot)plot;
    17
    CategoryPlot p = (CategoryPlot)plot;
    19
    rangeAxis = p.getRangeAxis();
    18
    rangeAxis = p.getRangeAxis();
    20
    else if (plot instanceof XYPlot)
    19
    else if (plot instanceof XYPlot)
    21
    XYPlot p = (XYPlot)plot;
    20
    XYPlot p = (XYPlot)plot;
    22
    rangeAxis = p.getRangeAxis();
    21
    rangeAxis = p.getRangeAxis();
    23
    if (rangeAxis != null)
    22
    if (rangeAxis != null)
    24
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    24
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    23
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.editor.DefaultAxisEditororg.jfree.experimental.chart.swt.editor.SWTAxisEditorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.editor.DefaultAxisEditor of variable this.rangeAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel
    • Make classes org.jfree.chart.editor.DefaultAxisEditor and org.jfree.experimental.chart.swt.editor.SWTAxisEditor extend a common superclass
    23
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    Precondition Violations (3)
    Row Violation
    1Type org.jfree.chart.editor.DefaultAxisEditor of variable this.rangeAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel
    2Type org.jfree.chart.editor.DefaultAxisEditor of variable this.rangeAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel
    3The refactoring of the clones is infeasible, because classes org.jfree.chart.editor.DefaultPlotEditor and org.jfree.experimental.chart.swt.editor.SWTPlotEditor do not have a common superclass