if (info != null) { info.setPlotArea(area); } // adjust the drawing area for plot insets (if any)... RectangleInsets insets = getInsets(); insets.trim(area); setFixedRangeAxisSpaceForSubplots(null); AxisSpace space = calculateAxisSpace(g2, area); Rectangle2D dataArea = space.shrink(area, null); // set the width and height of non-shared axis of all sub-plots setFixedRangeAxisSpaceForSubplots(space); // draw the shared axis ValueAxis axis = getDomainAxis(); RectangleEdge edge = getDomainAxisEdge(); double cursor = RectangleEdge.coordinate(dataArea, edge); AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info); if (parentState == null) { parentState = new PlotState(); } parentState.getSharedAxisStates().put(axis, axisState); // draw all the subplots for (int i = 0; i < this.subplots.size(); i++) { XYPlot plot = (XYPlot) this.subplots.get(i); PlotRenderingInfo subplotInfo = null; if (info != null) { subplotInfo = new PlotRenderingInfo(info.getOwner()); info.addSubplotInfo(subplotInfo); } plot.draw(g2, this.subplotAreas[i], anchor, parentState, subplotInfo); } if (info != null) { info.setDataArea(dataArea); }
if (info != null) { info.setPlotArea(area); } // adjust the drawing area for plot insets (if any)... RectangleInsets insets = getInsets(); insets.trim(area); AxisSpace space = calculateAxisSpace(g2, area); Rectangle2D dataArea = space.shrink(area, null); //this.axisOffset.trim(dataArea); // set the width and height of non-shared axis of all sub-plots setFixedDomainAxisSpaceForSubplots(space); // draw the shared axis ValueAxis axis = getRangeAxis(); RectangleEdge edge = getRangeAxisEdge(); double cursor = RectangleEdge.coordinate(dataArea, edge); AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info); if (parentState == null) { parentState = new PlotState(); } parentState.getSharedAxisStates().put(axis, axisState); // draw all the charts for (int i = 0; i < this.subplots.size(); i++) { XYPlot plot = (XYPlot) this.subplots.get(i); PlotRenderingInfo subplotInfo = null; if (info != null) { subplotInfo = new PlotRenderingInfo(info.getOwner()); info.addSubplotInfo(subplotInfo); } plot.draw(g2, this.subplotAreas[i], anchor, parentState, subplotInfo); } if (info != null) { info.setDataArea(dataArea); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo) Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
Number of AST nodes: 24 Number of AST nodes: 23
1
if (info != null) {
1
if (info != null) {
2
            info.setPlotArea(area);
2
            info.setPlotArea(area);
3
        }
3
        }
4
        // adjust the drawing area for plot insets (if any)...
4
        // adjust the drawing area for plot insets (if any)...
5
        RectangleInsets insets = getInsets();
5
        RectangleInsets insets = getInsets();
6
        insets.trim(area);
6
        insets.trim(area);
7
        setFixedRangeAxisSpaceForSubplots(null);
8
        AxisSpace space = calculateAxisSpace(g2, area);
7
        AxisSpace space = calculateAxisSpace(g2, area);
9
        Rectangle2D dataArea = space.shrink(area, null);
8
        Rectangle2D dataArea = space.shrink(area, null);
9
        //this.axisOffset.trim(dataArea);
10
        // set the width and height of non-shared axis of all sub-plots
10
        // set the width and height of non-shared axis of all sub-plots
11
        setFixedRangeAxisSpaceForSubplots(space);
11
        setFixedDomainAxisSpaceForSubplots(space);
12
        // draw the shared axis
12
        // draw the shared axis
13
        ValueAxis axis = getDomainAxis();
13
        ValueAxis axis = getRangeAxis();
14
        RectangleEdge edge = getDomainAxisEdge();
14
        RectangleEdge edge = getRangeAxisEdge();
15
        double cursor = RectangleEdge.coordinate(dataArea, edge);
15
        double cursor = RectangleEdge.coordinate(dataArea, edge);
16
        AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
16
        AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
17
        if (parentState == null) {
17
        if (parentState == null) {
18
            parentState = new PlotState();
18
            parentState = new PlotState();
19
        }
19
        }
20
        parentState.getSharedAxisStates().put(axis, axisState);
20
        parentState.getSharedAxisStates().put(axis, axisState);
21
        // draw all the subplots
21
        // draw all the charts
22
        for (int i = 0; i < this.subplots.size(); i++) {
22
        for (int i = 0; i < this.subplots.size(); i++) {
23
            XYPlot plot = (XYPlot) this.subplots.get(i);
23
            XYPlot plot = (XYPlot) this.subplots.get(i);
24
            PlotRenderingInfo subplotInfo = null;
24
            PlotRenderingInfo subplotInfo = null;
25
            if (info != null) {
25
            if (info != null) {
26
                subplotInfo = new PlotRenderingInfo(info.getOwner());
26
                subplotInfo = new PlotRenderingInfo(info.getOwner());
27
                info.addSubplotInfo(subplotInfo);
27
                info.addSubplotInfo(subplotInfo);
28
            }
28
            }
29
            plot.draw(g2, this.subplotAreas[i], anchor, parentState,
29
            plot.draw(g2, this.subplotAreas[i], anchor, parentState,
30
                    subplotInfo);
30
                    subplotInfo);
31
        }
31
        }
32
        if (info != null) {
32
        if (info != null) {
33
            info.setDataArea(dataArea);
33
            info.setDataArea(dataArea);
34
        }
34
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.4
Clones locationClones are in different classes having the same super class
Number of node comparisons137
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements23
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)139.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (info != null)
    1
    if (info != null)
    2
    info.setPlotArea(area);
    2
    info.setPlotArea(area);
    3
    RectangleInsets insets = getInsets();
    3
    RectangleInsets insets = getInsets();
    4
    insets.trim(area);
    4
    insets.trim(area);
    5
    setFixedRangeAxisSpaceForSubplots(null);
                                                                                          
    6
    AxisSpace space = calculateAxisSpace(g2, area);
    5
    AxisSpace space = calculateAxisSpace(g2, area);
    7
    Rectangle2D dataArea = space.shrink(area, null);
    6
    Rectangle2D dataArea = space.shrink(area, null);
    8
    setFixedRangeAxisSpaceForSubplots(space);
    8
    setFixedRangeAxisSpaceForSubplots(space);
    7
    setFixedDomainAxisSpaceForSubplots(space);
    Differences
    Expression1Expression2Difference
    setFixedRangeAxisSpaceForSubplotssetFixedDomainAxisSpaceForSubplotsMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression setFixedRangeAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setFixedDomainAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setFixedRangeAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized
    Expression setFixedDomainAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized
    7
    setFixedDomainAxisSpaceForSubplots(space);
    9
    ValueAxis axis = getDomainAxis();
    9
    ValueAxis axis = getDomainAxis();
    8
    ValueAxis axis = getRangeAxis();
    Differences
    Expression1Expression2Difference
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    8
    ValueAxis axis = getRangeAxis();
    10
    RectangleEdge edge = getDomainAxisEdge();
    10
    RectangleEdge edge = getDomainAxisEdge();
    9
    RectangleEdge edge = getRangeAxisEdge();
    Differences
    Expression1Expression2Difference
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    9
    RectangleEdge edge = getRangeAxisEdge();
    11
    double cursor = RectangleEdge.coordinate(dataArea, edge);
    10
    double cursor = RectangleEdge.coordinate(dataArea, edge);
    12
    AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
    11
    AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
    13
    if (parentState == null)
    12
    if (parentState == null)
    14
    parentState = new PlotState();
    13
    parentState = new PlotState();
    15
    parentState.getSharedAxisStates().put(axis, axisState);
    14
    parentState.getSharedAxisStates().put(axis, axisState);
    16
    for (int i = 0; i < this.subplots.size(); i++)
    15
    for (int i = 0; i < this.subplots.size(); i++)
    17
    XYPlot plot = (XYPlot)this.subplots.get(i);
    16
    XYPlot plot = (XYPlot)this.subplots.get(i);
    18
    PlotRenderingInfo subplotInfo = null;
    17
    PlotRenderingInfo subplotInfo = null;
    19
    if (info != null)
    18
    if (info != null)
    20
    subplotInfo = new PlotRenderingInfo(info.getOwner());
    19
    subplotInfo = new PlotRenderingInfo(info.getOwner());
    21
    info.addSubplotInfo(subplotInfo);
    20
    info.addSubplotInfo(subplotInfo);
    22
    plot.draw(g2, this.subplotAreas[i], anchor, parentState, subplotInfo);
    21
    plot.draw(g2, this.subplotAreas[i], anchor, parentState, subplotInfo);
    23
    if (info != null)
    22
    if (info != null)
    24
    info.setDataArea(dataArea);
    23
    info.setDataArea(dataArea);
    Precondition Violations (4)
    Row Violation
    1Expression setFixedRangeAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression setFixedDomainAxisSpaceForSubplots(space) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression setFixedRangeAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized
    4Expression setFixedDomainAxisSpaceForSubplots(space) is a void method call, and thus it cannot be parameterized