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); }
Axis domainAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); } if (domainAxis != null) this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
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: 9 Number of AST nodes: 9
1
Axis rangeAxis = null;
1
Axis domainAxis = null;
2
            if (plot instanceof CategoryPlot) {
2
            if (plot instanceof CategoryPlot) {
3
                CategoryPlot p = (CategoryPlot) plot;
3
                CategoryPlot p = (CategoryPlot) plot;
4
                rangeAxis = p.getRangeAxis();
4
                domainAxis = p.getDomainAxis();
5
            }
5
            }
6
            else if (plot instanceof XYPlot) {
6
            else if (plot instanceof XYPlot) {
7
                XYPlot p = (XYPlot) plot;
7
                XYPlot p = (XYPlot) plot;
8
                rangeAxis = p.getRangeAxis();
8
                domainAxis = p.getDomainAxis();
9
            }
9
            }
10
            if (rangeAxis != null) {
10
            if (domainAxis != null)
11
                this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
11
                this.domainAxisPropertyPanel.setAxisProperties(
12
            }
12
domainAxis);
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 comparisons38
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)105.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    16
    Axis rangeAxis = null;
    16
    Axis rangeAxis = null;
    5
    Axis domainAxis = null;
    Differences
    Expression1Expression2Difference
    rangeAxisdomainAxisVARIABLE_NAME_MISMATCH
    5
    Axis domainAxis = null;
    17
    if (plot instanceof CategoryPlot)
    6
    if (plot instanceof CategoryPlot)
    18
    CategoryPlot p = (CategoryPlot)plot;
    7
    CategoryPlot p = (CategoryPlot)plot;
    19
    rangeAxis = p.getRangeAxis();
    19
    rangeAxis = p.getRangeAxis();
    8
    domainAxis = p.getDomainAxis();
    Differences
    Expression1Expression2Difference
    rangeAxisdomainAxisVARIABLE_NAME_MISMATCH
    getRangeAxisgetDomainAxisMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    domainAxis = p.getDomainAxis();
    20
    else if (plot instanceof XYPlot)
    9
    else if (plot instanceof XYPlot)
    21
    XYPlot p = (XYPlot)plot;
    10
    XYPlot p = (XYPlot)plot;
    22
    rangeAxis = p.getRangeAxis();
    22
    rangeAxis = p.getRangeAxis();
    11
    domainAxis = p.getDomainAxis();
    Differences
    Expression1Expression2Difference
    rangeAxisdomainAxisVARIABLE_NAME_MISMATCH
    getRangeAxisgetDomainAxisMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    domainAxis = p.getDomainAxis();
    23
    if (rangeAxis != null)
    23
    if (rangeAxis != null)
    12
    if (domainAxis != null)
    Differences
    Expression1Expression2Difference
    rangeAxisdomainAxisVARIABLE_NAME_MISMATCH
    12
    if (domainAxis != null)
    24
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    24
    this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);
    13
    this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
    Differences
    Expression1Expression2Difference
    rangeAxisdomainAxisVARIABLE_NAME_MISMATCH
    rangeAxisPropertyPaneldomainAxisPropertyPanelVARIABLE_NAME_MISMATCH
    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.domainAxisPropertyPanel
    • Make classes org.jfree.chart.editor.DefaultAxisEditor and org.jfree.experimental.chart.swt.editor.SWTAxisEditor extend a common superclass
    13
    this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
    Precondition Violations (6)
    Row Violation
    1Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.jfree.chart.editor.DefaultAxisEditor of variable this.rangeAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.domainAxisPropertyPanel
    6The 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