CategoryItemRenderer r = getRenderer(index); if (r == null) { return; } Collection markers = getDomainMarkers(index, layer); CategoryAxis axis = getDomainAxisForDataset(index); if (markers != null && axis != null) { Iterator iterator = markers.iterator(); while (iterator.hasNext()) { CategoryMarker marker = (CategoryMarker) iterator.next(); r.drawDomainMarker(g2, this, axis, marker, dataArea); } }
CategoryItemRenderer r = getRenderer(index); if (r == null) { return; } Collection markers = getRangeMarkers(index, layer); ValueAxis axis = getRangeAxisForDataset(index); if (markers != null && axis != null) { Iterator iterator = markers.iterator(); while (iterator.hasNext()) { Marker marker = (Marker) iterator.next(); r.drawRangeMarker(g2, this, axis, marker, dataArea); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
Method name: void drawDomainMarkers(Graphics2D, Rectangle2D, int, Layer) Method name: void drawRangeMarkers(Graphics2D, Rectangle2D, int, Layer)
Number of AST nodes: 10 Number of AST nodes: 10
1
CategoryItemRenderer r = getRenderer(index);
1
CategoryItemRenderer r = getRenderer(index);
2
        if (r == null) {
2
        if (r == null) {
3
            return;
3
            return;
4
        }
4
        }
5
        Collection markers = getDomainMarkers(index, layer);
5
        Collection markers = getRangeMarkers(index, layer);
6
        CategoryAxis axis = getDomainAxisForDataset(index);
6
        ValueAxis axis = getRangeAxisForDataset(index);
7
        if (markers != null && axis != null) {
7
        if (markers != null && axis != null) {
8
            Iterator iterator = markers.iterator();
8
            Iterator iterator = markers.iterator();
9
            while (iterator.hasNext()) {
9
            while (iterator.hasNext()) {
10
                CategoryMarker marker = (CategoryMarker) iterator.next();
10
                Marker marker = (Marker) iterator.next();
11
                r.drawDomainMarker(g2, this, axis, marker, dataArea);
11
                r.drawRangeMarker(g2, this, axis, marker, dataArea);
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.4
Clones locationClones are declared in the same class
Number of node comparisons26
  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)525.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    CategoryItemRenderer r = getRenderer(index);
    1
    CategoryItemRenderer r = getRenderer(index);
    2
    if (r == null)
    2
    if (r == null)
    3
    return;
    3
    return;
    4
    Collection markers = getDomainMarkers(index, layer);
    4
    Collection markers = getDomainMarkers(index, layer);
    4
    Collection markers = getRangeMarkers(index, layer);
    Differences
    Expression1Expression2Difference
    getDomainMarkersgetRangeMarkersMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getDomainMarkers(index,layer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRangeMarkers(index,layer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    Collection markers = getRangeMarkers(index, layer);
    5
    CategoryAxis axis = getDomainAxisForDataset(index);
    5
    CategoryAxis axis = getDomainAxisForDataset(index);
    5
    ValueAxis axis = getRangeAxisForDataset(index);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    getDomainAxisForDatasetgetRangeAxisForDatasetMETHOD_INVOCATION_NAME_MISMATCH
    5
    ValueAxis axis = getRangeAxisForDataset(index);
    6
    if (markers != null && axis != null)
    6
    if (markers != null && axis != null)
    6
    if (markers != null && axis != null)
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    6
    if (markers != null && axis != null)
    7
    Iterator iterator = markers.iterator();
    7
    Iterator iterator = markers.iterator();
    8
    while (iterator.hasNext())
    8
    while (iterator.hasNext())
    9
    CategoryMarker marker = (CategoryMarker)iterator.next();
    9
    CategoryMarker marker = (CategoryMarker)iterator.next();
    9
    Marker marker = (Marker)iterator.next();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.CategoryMarkerorg.jfree.chart.plot.MarkerSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryMarkerorg.jfree.chart.plot.MarkerSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryMarkerorg.jfree.chart.plot.MarkerSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (CategoryMarker)iterator.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (Marker)iterator.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9
    Marker marker = (Marker)iterator.next();
    10
    r.drawDomainMarker(g2, this, axis, marker, dataArea);
    10
    r.drawDomainMarker(g2, this, axis, marker, dataArea);
    10
    r.drawRangeMarker(g2, this, axis, marker, dataArea);
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.CategoryAxisorg.jfree.chart.axis.ValueAxisSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.CategoryMarkerorg.jfree.chart.plot.MarkerSUBCLASS_TYPE_MISMATCH
    drawDomainMarkerdrawRangeMarkerMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression r.drawDomainMarker(g2,this,axis,marker,dataArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.drawRangeMarker(g2,this,axis,marker,dataArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression r.drawDomainMarker(g2,this,axis,marker,dataArea) is a void method call, and thus it cannot be parameterized
    Expression r.drawRangeMarker(g2,this,axis,marker,dataArea) is a void method call, and thus it cannot be parameterized
    10
    r.drawRangeMarker(g2, this, axis, marker, dataArea);
    Precondition Violations (8)
    Row Violation
    1Expression getDomainMarkers(index,layer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getRangeMarkers(index,layer) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression (CategoryMarker)iterator.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression (Marker)iterator.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression r.drawDomainMarker(g2,this,axis,marker,dataArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression r.drawRangeMarker(g2,this,axis,marker,dataArea) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression r.drawDomainMarker(g2,this,axis,marker,dataArea) is a void method call, and thus it cannot be parameterized
    8Expression r.drawRangeMarker(g2,this,axis,marker,dataArea) is a void method call, and thus it cannot be parameterized