if (marker instanceof IntervalMarker) { IntervalMarker im = (IntervalMarker) marker; double start = im.getStartValue(); double end = im.getEndValue(); Range range = domainAxis.getRange(); if (!(range.intersects(start, end))) { return; } double start2d = domainAxis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge()); double end2d = domainAxis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge()); double low = Math.min(start2d, end2d); double high = Math.max(start2d, end2d); PlotOrientation orientation = plot.getOrientation(); Rectangle2D rect = null; if (orientation == PlotOrientation.HORIZONTAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); } else if (orientation == PlotOrientation.VERTICAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); } final Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); Paint p = marker.getPaint(); if (p instanceof GradientPaint) { GradientPaint gp = (GradientPaint) p; GradientPaintTransformer t = im.getGradientPaintTransformer(); if (t != null) { gp = t.transform(gp, rect); } g2.setPaint(gp); } else { g2.setPaint(p); } g2.fill(rect); // now draw the outlines, if visible... if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) { if (orientation == PlotOrientation.VERTICAL) { Line2D line = new Line2D.Double(); double y0 = dataArea.getMinY(); double y1 = dataArea.getMaxY(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(start2d, y0, start2d, y1); g2.draw(line); } if (range.contains(end)) { line.setLine(end2d, y0, end2d, y1); g2.draw(line); } } else { // PlotOrientation.HORIZONTAL Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(x0, start2d, x1, start2d); g2.draw(line); } if (range.contains(end)) { line.setLine(x0, end2d, x1, end2d); g2.draw(line); } } } String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateDomainMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(originalComposite); }
if (marker instanceof IntervalMarker) { IntervalMarker im = (IntervalMarker) marker; double start = im.getStartValue(); double end = im.getEndValue(); Range range = rangeAxis.getRange(); if (!(range.intersects(start, end))) { return; } double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge()); double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge()); double low = Math.min(start2d, end2d); double high = Math.max(start2d, end2d); PlotOrientation orientation = plot.getOrientation(); Rectangle2D rect = null; if (orientation == PlotOrientation.HORIZONTAL) { // clip left and right bounds to data area low = Math.max(low, dataArea.getMinX()); high = Math.min(high, dataArea.getMaxX()); rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight()); } else if (orientation == PlotOrientation.VERTICAL) { // clip top and bottom bounds to data area low = Math.max(low, dataArea.getMinY()); high = Math.min(high, dataArea.getMaxY()); rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low); } final Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); Paint p = marker.getPaint(); if (p instanceof GradientPaint) { GradientPaint gp = (GradientPaint) p; GradientPaintTransformer t = im.getGradientPaintTransformer(); if (t != null) { gp = t.transform(gp, rect); } g2.setPaint(gp); } else { g2.setPaint(p); } g2.fill(rect); // now draw the outlines, if visible... if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) { if (orientation == PlotOrientation.VERTICAL) { Line2D line = new Line2D.Double(); double x0 = dataArea.getMinX(); double x1 = dataArea.getMaxX(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(x0, start2d, x1, start2d); g2.draw(line); } if (range.contains(end)) { line.setLine(x0, end2d, x1, end2d); g2.draw(line); } } else { // PlotOrientation.HORIZONTAL Line2D line = new Line2D.Double(); double y0 = dataArea.getMinY(); double y1 = dataArea.getMaxY(); g2.setPaint(im.getOutlinePaint()); g2.setStroke(im.getOutlineStroke()); if (range.contains(start)) { line.setLine(start2d, y0, start2d, y1); g2.draw(line); } if (range.contains(end)) { line.setLine(end2d, y0, end2d, y1); g2.draw(line); } } } String label = marker.getLabel(); RectangleAnchor anchor = marker.getLabelAnchor(); if (label != null) { Font labelFont = marker.getLabelFont(); g2.setFont(labelFont); g2.setPaint(marker.getLabelPaint()); Point2D coordinates = calculateRangeMarkerTextAnchorPoint( g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor); TextUtilities.drawAlignedString(label, g2, (float) coordinates.getX(), (float) coordinates.getY(), marker.getLabelTextAnchor()); } g2.setComposite(originalComposite); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java
Method name: void drawDomainMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D) Method name: void drawRangeMarker(Graphics2D, XYPlot, ValueAxis, Marker, Rectangle2D)
Number of AST nodes: 65 Number of AST nodes: 65
1
if (marker instanceof IntervalMarker) {
1
if (marker instanceof IntervalMarker) {
2
            IntervalMarker im = (IntervalMarker) marker;
2
            IntervalMarker im = (IntervalMarker) marker;
3
            double start = im.getStartValue();
3
            double start = im.getStartValue();
4
            double end = im.getEndValue();
4
            double end = im.getEndValue();
5
            Range range = domainAxis.getRange();
5
            Range range = rangeAxis.getRange();
6
            if (!(range.intersects(start, end))) {
6
            if (!(range.intersects(start, end))) {
7
                return;
7
                return;
8
            }
8
            }
9
            double start2d = domainAxis.valueToJava2D(start, dataArea,
9
            double start2d = rangeAxis.valueToJava2D(start, dataArea,
10
                    plot.getDomainAxisEdge());
10
                    plot.getRangeAxisEdge());
11
            double end2d = domainAxis.valueToJava2D(end, dataArea,
11
            double end2d = rangeAxis.valueToJava2D(end, dataArea,
12
                    plot.getDomainAxisEdge());
12
                    plot.getRangeAxisEdge());
13
            double low = Math.min(start2d, end2d);
13
            double low = Math.min(start2d, end2d);
14
            double high = Math.max(start2d, end2d);
14
            double high = Math.max(start2d, end2d);
15
            PlotOrientation orientation = plot.getOrientation();
15
            PlotOrientation orientation = plot.getOrientation();
16
            Rectangle2D rect = null;
16
            Rectangle2D rect = null;
17
            if (orientation == PlotOrientation.HORIZONTAL) {
17
            if (orientation == PlotOrientation.HORIZONTAL) {
18
                // clip top and bottom bounds to data area
18
                // clip left and right bounds to data area
19
                low = Math.max(low, dataArea.getMinY());
19
                low = Math.max(low, dataArea.getMinX());
20
                high = Math.min(high, dataArea.getMaxY());
20
                high = Math.min(high, dataArea.getMaxX());
21
                rect = new Rectangle2D.Double(dataArea.getMinX(),
21
                rect = new Rectangle2D.Double(low,
22
                        low, dataArea.getWidth(),
22
                        dataArea.getMinY(), high - low,
23
                        high - low);
23
                        dataArea.getHeight());
24
            }
24
            }
25
            else if (orientation == PlotOrientation.VERTICAL) {
25
            else if (orientation == PlotOrientation.VERTICAL) {
26
                // clip left and right bounds to data area
26
                // clip top and bottom bounds to data area
27
                low = Math.max(low, dataArea.getMinX());
27
                low = Math.max(low, dataArea.getMinY());
28
                high = Math.min(high, dataArea.getMaxX());
28
                high = Math.min(high, dataArea.getMaxY());
29
                rect = new Rectangle2D.Double(low,
29
                rect = new Rectangle2D.Double(dataArea.getMinX(),
30
                        dataArea.getMinY(), high - low,
30
                        low, dataArea.getWidth(),
31
                        dataArea.getHeight());
31
                        high - low);
32
            }
32
            }
33
            final Composite originalComposite = g2.getComposite();
33
            final Composite originalComposite = g2.getComposite();
34
            g2.setComposite(AlphaComposite.getInstance(
34
            g2.setComposite(AlphaComposite.getInstance(
35
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
35
                    AlphaComposite.SRC_OVER, marker.getAlpha()));
36
            Paint p = marker.getPaint();
36
            Paint p = marker.getPaint();
37
            if (p instanceof GradientPaint) {
37
            if (p instanceof GradientPaint) {
38
                GradientPaint gp = (GradientPaint) p;
38
                GradientPaint gp = (GradientPaint) p;
39
                GradientPaintTransformer t = im.getGradientPaintTransformer();
39
                GradientPaintTransformer t = im.getGradientPaintTransformer();
40
                if (t != null) {
40
                if (t != null) {
41
                    gp = t.transform(gp, rect);
41
                    gp = t.transform(gp, rect);
42
                }
42
                }
43
                g2.setPaint(gp);
43
                g2.setPaint(gp);
44
            }
44
            }
45
            else {
45
            else {
46
                g2.setPaint(p);
46
                g2.setPaint(p);
47
            }
47
            }
48
            g2.fill(rect);
48
            g2.fill(rect);
49
            // now draw the outlines, if visible...
49
            // now draw the outlines, if visible...
50
            if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {
50
            if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {
51
                if (orientation == PlotOrientation.VERTICAL) {
51
                if (orientation == PlotOrientation.VERTICAL) {
52
                    Line2D line = new Line2D.Double();
52
                    Line2D line = new Line2D.Double();
53
                    double y0 = dataArea.getMinY();
53
                    double x0 = dataArea.getMinX();
54
                    double y1 = dataArea.getMaxY();
54
                    double x1 = dataArea.getMaxX();
55
                    g2.setPaint(im.getOutlinePaint());
55
                    g2.setPaint(im.getOutlinePaint());
56
                    g2.setStroke(im.getOutlineStroke());
56
                    g2.setStroke(im.getOutlineStroke());
57
                    if (range.contains(start)) {
57
                    if (range.contains(start)) {
58
                        line.setLine(start2d, y0, start2d, y1);
58
                        line.setLine(x0, start2d, x1, start2d);
59
                        g2.draw(line);
59
                        g2.draw(line);
60
                    }
60
                    }
61
                    if (range.contains(end)) {
61
                    if (range.contains(end)) {
62
                        line.setLine(end2d, y0, end2d, y1);
62
                        line.setLine(x0, end2d, x1, end2d);
63
                        g2.draw(line);
63
                        g2.draw(line);
64
                    }
64
                    }
65
                }
65
                }
66
                else { // PlotOrientation.HORIZONTAL
66
                else { // PlotOrientation.HORIZONTAL
67
                    Line2D line = new Line2D.Double();
67
                    Line2D line = new Line2D.Double();
68
                    double x0 = dataArea.getMinX();
68
                    double y0 = dataArea.getMinY();
69
                    double x1 = dataArea.getMaxX();
69
                    double y1 = dataArea.getMaxY();
70
                    g2.setPaint(im.getOutlinePaint());
70
                    g2.setPaint(im.getOutlinePaint());
71
                    g2.setStroke(im.getOutlineStroke());
71
                    g2.setStroke(im.getOutlineStroke());
72
                    if (range.contains(start)) {
72
                    if (range.contains(start)) {
73
                        line.setLine(x0, start2d, x1, start2d);
73
                        line.setLine(start2d, y0, start2d, y1);
74
                        g2.draw(line);
74
                        g2.draw(line);
75
                    }
75
                    }
76
                    if (range.contains(end)) {
76
                    if (range.contains(end)) {
77
                        line.setLine(x0, end2d, x1, end2d);
77
                        line.setLine(end2d, y0, end2d, y1);
78
                        g2.draw(line);
78
                        g2.draw(line);
79
                    }
79
                    }
80
                }
80
                }
81
            }
81
            }
82
            String label = marker.getLabel();
82
            String label = marker.getLabel();
83
            RectangleAnchor anchor = marker.getLabelAnchor();
83
            RectangleAnchor anchor = marker.getLabelAnchor();
84
            if (label != null) {
84
            if (label != null) {
85
                Font labelFont = marker.getLabelFont();
85
                Font labelFont = marker.getLabelFont();
86
                g2.setFont(labelFont);
86
                g2.setFont(labelFont);
87
                g2.setPaint(marker.getLabelPaint());
87
                g2.setPaint(marker.getLabelPaint());
88
                Point2D coordinates = calculateDomainMarkerTextAnchorPoint(
88
                Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
89
                        g2, orientation, dataArea, rect,
89
                        g2, orientation, dataArea, rect,
90
                        marker.getLabelOffset(), marker.getLabelOffsetType(),
90
                        marker.getLabelOffset(), marker.getLabelOffsetType(),
91
                        anchor);
91
                        anchor);
92
                TextUtilities.drawAlignedString(label, g2,
92
                TextUtilities.drawAlignedString(label, g2,
93
                        (float) coordinates.getX(), (float) coordinates.getY(),
93
                        (float) coordinates.getX(), (float) coordinates.getY(),
94
                        marker.getLabelTextAnchor());
94
                        marker.getLabelTextAnchor());
95
            }
95
            }
96
            g2.setComposite(originalComposite);
96
            g2.setComposite(originalComposite);
97
        }
97
        }
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)5.2
Clones locationClones are declared in the same class
Number of node comparisons596
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements65
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)234.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    28
    else if (marker instanceof IntervalMarker)
    28
    else if (marker instanceof IntervalMarker)
    29
    IntervalMarker im = (IntervalMarker)marker;
    29
    IntervalMarker im = (IntervalMarker)marker;
    30
    double start = im.getStartValue();
    30
    double start = im.getStartValue();
    31
    double end = im.getEndValue();
    31
    double end = im.getEndValue();
    32
    Range range = domainAxis.getRange();
    32
    Range range = domainAxis.getRange();
    32
    Range range = rangeAxis.getRange();
    Differences
    Expression1Expression2Difference
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    32
    Range range = rangeAxis.getRange();
    33
    if (!(range.intersects(start, end)))
    33
    if (!(range.intersects(start, end)))
    34
    return;
    34
    return;
    34
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    34
    return;
    35
    double start2d = domainAxis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge());
    35
    double start2d = domainAxis.valueToJava2D(start, dataArea, plot.getDomainAxisEdge());
    35
    double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression plot.getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression plot.getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    35
    double start2d = rangeAxis.valueToJava2D(start, dataArea, plot.getRangeAxisEdge());
    36
    double end2d = domainAxis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge());
    36
    double end2d = domainAxis.valueToJava2D(end, dataArea, plot.getDomainAxisEdge());
    36
    double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    domainAxisrangeAxisVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression plot.getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression plot.getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    36
    double end2d = rangeAxis.valueToJava2D(end, dataArea, plot.getRangeAxisEdge());
    37
    double low = Math.min(start2d, end2d);
    37
    double low = Math.min(start2d, end2d);
    38
    double high = Math.max(start2d, end2d);
    38
    double high = Math.max(start2d, end2d);
    39
    PlotOrientation orientation = plot.getOrientation();
    39
    PlotOrientation orientation = plot.getOrientation();
    40
    Rectangle2D rect = null;
    40
    Rectangle2D rect = null;
    41
    if (orientation == PlotOrientation.HORIZONTAL)
    41
    if (orientation == PlotOrientation.HORIZONTAL)
    45
    if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    HORIZONTALVERTICALVARIABLE_NAME_MISMATCH
    45
    if (orientation == PlotOrientation.VERTICAL)
    42
    low = Math.max(low, dataArea.getMinY());
    46
    low = Math.max(low, dataArea.getMinY());
    43
    high = Math.min(high, dataArea.getMaxY());
    47
    high = Math.min(high, dataArea.getMaxY());
    44
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    48
    rect = new Rectangle2D.Double(dataArea.getMinX(), low, dataArea.getWidth(), high - low);
    45
    else if (orientation == PlotOrientation.VERTICAL)
    45
    else if (orientation == PlotOrientation.VERTICAL)
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    VERTICALHORIZONTALVARIABLE_NAME_MISMATCH
    41
    else if (orientation == PlotOrientation.HORIZONTAL)
    46
    low = Math.max(low, dataArea.getMinX());
    42
    low = Math.max(low, dataArea.getMinX());
    47
    high = Math.min(high, dataArea.getMaxX());
    43
    high = Math.min(high, dataArea.getMaxX());
    48
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    44
    rect = new Rectangle2D.Double(low, dataArea.getMinY(), high - low, dataArea.getHeight());
    49
    final Composite originalComposite = g2.getComposite();
    49
    final Composite originalComposite = g2.getComposite();
    50
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    50
    g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, marker.getAlpha()));
    51
    Paint p = marker.getPaint();
    51
    Paint p = marker.getPaint();
    52
    if (p instanceof GradientPaint)
    52
    if (p instanceof GradientPaint)
    53
    GradientPaint gp = (GradientPaint)p;
    53
    GradientPaint gp = (GradientPaint)p;
    54
    GradientPaintTransformer t = im.getGradientPaintTransformer();
    54
    GradientPaintTransformer t = im.getGradientPaintTransformer();
    55
    if (t != null)
    55
    if (t != null)
    56
    gp = t.transform(gp, rect);
    56
    gp = t.transform(gp, rect);
    57
    g2.setPaint(gp);
    57
    g2.setPaint(gp);
    else
    else
    58
    g2.setPaint(p);
    58
    g2.setPaint(p);
    59
    g2.fill(rect);
    59
    g2.fill(rect);
    60
    if (im.getOutlinePaint() != null && im.getOutlineStroke() != null)
    60
    if (im.getOutlinePaint() != null && im.getOutlineStroke() != null)
    61
    if (orientation == PlotOrientation.VERTICAL)
    61
    if (orientation == PlotOrientation.VERTICAL)
    61
    if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    orientation == PlotOrientation.VERTICALorientation == PlotOrientation.VERTICALIF_ELSE_SYMMETRICAL_MATCH
    Preondition Violations
    Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted
    61
    if (orientation == PlotOrientation.VERTICAL)
    62
    Line2D line = new Line2D.Double();
    73
    Line2D line = new Line2D.Double();
    63
    double y0 = dataArea.getMinY();
    74
    double y0 = dataArea.getMinY();
    64
    double y1 = dataArea.getMaxY();
    75
    double y1 = dataArea.getMaxY();
    65
    g2.setPaint(im.getOutlinePaint());
    76
    g2.setPaint(im.getOutlinePaint());
    66
    g2.setStroke(im.getOutlineStroke());
    77
    g2.setStroke(im.getOutlineStroke());
    67
    if (range.contains(start))
    78
    if (range.contains(start))
    68
    line.setLine(start2d, y0, start2d, y1);
    79
    line.setLine(start2d, y0, start2d, y1);
    69
    g2.draw(line);
    80
    g2.draw(line);
    70
    if (range.contains(end))
    81
    if (range.contains(end))
    71
    line.setLine(end2d, y0, end2d, y1);
    82
    line.setLine(end2d, y0, end2d, y1);
    72
    g2.draw(line);
    83
    g2.draw(line);
    else
    else
    73
    Line2D line = new Line2D.Double();
    62
    Line2D line = new Line2D.Double();
    74
    double x0 = dataArea.getMinX();
    63
    double x0 = dataArea.getMinX();
    75
    double x1 = dataArea.getMaxX();
    64
    double x1 = dataArea.getMaxX();
    76
    g2.setPaint(im.getOutlinePaint());
    65
    g2.setPaint(im.getOutlinePaint());
    77
    g2.setStroke(im.getOutlineStroke());
    66
    g2.setStroke(im.getOutlineStroke());
    78
    if (range.contains(start))
    67
    if (range.contains(start))
    79
    line.setLine(x0, start2d, x1, start2d);
    68
    line.setLine(x0, start2d, x1, start2d);
    80
    g2.draw(line);
    69
    g2.draw(line);
    81
    if (range.contains(end))
    70
    if (range.contains(end))
    82
    line.setLine(x0, end2d, x1, end2d);
    71
    line.setLine(x0, end2d, x1, end2d);
    83
    g2.draw(line);
    72
    g2.draw(line);
    84
    String label = marker.getLabel();
    84
    String label = marker.getLabel();
    85
    RectangleAnchor anchor = marker.getLabelAnchor();
    85
    RectangleAnchor anchor = marker.getLabelAnchor();
    86
    if (label != null)
    86
    if (label != null)
    87
    Font labelFont = marker.getLabelFont();
    87
    Font labelFont = marker.getLabelFont();
    88
    g2.setFont(labelFont);
    88
    g2.setFont(labelFont);
    89
    g2.setPaint(marker.getLabelPaint());
    89
    g2.setPaint(marker.getLabelPaint());
    90
    Point2D coordinates = calculateDomainMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    90
    Point2D coordinates = calculateDomainMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    90
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    Differences
    Expression1Expression2Difference
    calculateDomainMarkerTextAnchorPointcalculateRangeMarkerTextAnchorPointMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression calculateDomainMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression calculateRangeMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method calculateRangeMarkerTextAnchorPoint
    90
    Point2D coordinates = calculateRangeMarkerTextAnchorPoint(g2, orientation, dataArea, rect, marker.getLabelOffset(), marker.getLabelOffsetType(), anchor);
    91
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    91
    TextUtilities.drawAlignedString(label, g2, (float)coordinates.getX(), (float)coordinates.getY(), marker.getLabelTextAnchor());
    92
    g2.setComposite(originalComposite);
    92
    g2.setComposite(originalComposite);
    Precondition Violations (10)
    Row Violation
    1Conditional return;
    2Conditional return;
    3Expression plot.getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression plot.getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5Expression plot.getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    6Expression plot.getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    7Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression orientation == PlotOrientation.VERTICAL cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression calculateDomainMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression calculateRangeMarkerTextAnchorPoint(g2,orientation,dataArea,rect,marker.getLabelOffset(),marker.getLabelOffsetType(),anchor) cannot be parameterized, because it has dependencies to/from statements that will be extracted