if (entities != null) { String tip = null; if (getToolTipGenerator() != null) { tip = this.toolTipGenerator.generateToolTip(data, k); } String url = null; // if (getURLGenerator() != null) { //dmo: look at this later // url = getURLGenerator().generateURL(data, series, item); // } // Unlike XYItemRenderer, we need to clone entityArea since it // reused. ContourEntity entity = new ContourEntity( (RectangularShape) entityArea.clone(), tip, url); entity.setIndex(k); entities.add(entity); }
if (entities != null) { String tip = ""; if (getToolTipGenerator() != null) { tip = this.toolTipGenerator.generateToolTip(data, k); } // Shape s = g2.getClip(); // if (s.contains(rect) || s.intersects(rect)) { String url = null; // if (getURLGenerator() != null) { //dmo: look at this later // url = getURLGenerator().generateURL(data, series, item); // } // Unlike XYItemRenderer, we need to clone entityArea since it // reused. ContourEntity entity = new ContourEntity( (Rectangle2D.Double) entityArea.clone(), tip, url); entity.setIndex(k); entities.add(entity); // } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ContourPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ContourPlot.java
Method name: void pointRenderer(Graphics2D, Rectangle2D, PlotRenderingInfo, ContourPlot, ValueAxis, ValueAxis, ColorBar, ContourDataset, CrosshairState) Method name: void contourRenderer(Graphics2D, Rectangle2D, PlotRenderingInfo, ContourPlot, ValueAxis, ValueAxis, ColorBar, ContourDataset, CrosshairState)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (entities != null) {
1
if (entities != null) {
2
                String tip = null;
2
                String tip = "";
3
                if (getToolTipGenerator() != null) {
3
                if (getToolTipGenerator() != null) {
4
                    tip = this.toolTipGenerator.generateToolTip(data, k);
4
                    tip = this.toolTipGenerator.generateToolTip(data, k);
5
                }
5
                }
6
//              Shape s = g2.getClip();
7
//              if (s.contains(rect) || s.intersects(rect)) {
6
                String url = null;
8
                String url = null;
7
                // if (getURLGenerator() != null) {   //dmo: look at this later
9
                // if (getURLGenerator() != null) {    //dmo: look at this later
8
                //   url = getURLGenerator().generateURL(data, series, item);
10
                //      url = getURLGenerator().generateURL(data, series, item);
9
                // }
11
                // }
10
                // Unlike XYItemRenderer, we need to clone entityArea since it 
12
                // Unlike XYItemRenderer, we need to clone entityArea since it 
11
                // reused.
13
                // reused.
12
                ContourEntity entity = new ContourEntity(
14
                ContourEntity entity = new ContourEntity(
13
                        (RectangularShape) entityArea.clone(), tip, url);
15
                        (Rectangle2D.Double) entityArea.clone(), tip, url);
14
                entity.setIndex(k);
16
                entity.setIndex(k);
15
                entities.add(entity);
17
                entities.add(entity);
18
//              }
16
            }
19
            }
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)25.3
Clones locationClones are declared in the same class
Number of node comparisons41
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    34
    if (entities != null)
    88
    if (entities != null)
    35
    String tip = null;
    35
    String tip = null;
    89
    String tip = "";
    Differences
    Expression1Expression2Difference
    null""TYPE_COMPATIBLE_REPLACEMENT
    89
    String tip = "";
    36
    if (getToolTipGenerator() != null)
    90
    if (getToolTipGenerator() != null)
    37
    tip = this.toolTipGenerator.generateToolTip(data, k);
    91
    tip = this.toolTipGenerator.generateToolTip(data, k);
    38
    String url = null;
    92
    String url = null;
    39
    ContourEntity entity = new ContourEntity((RectangularShape)entityArea.clone(), tip, url);
    39
    ContourEntity entity = new ContourEntity((RectangularShape)entityArea.clone(), tip, url);
    93
    ContourEntity entity = new ContourEntity((Rectangle2D.Double)entityArea.clone(), tip, url);
    Differences
    Expression1Expression2Difference
    RectangularShapeRectangle2D.DoubleTYPE_COMPATIBLE_REPLACEMENT
    java.awt.geom.RectangularShapejava.awt.geom.Rectangle2D.DoubleSUBCLASS_TYPE_MISMATCH
    93
    ContourEntity entity = new ContourEntity((Rectangle2D.Double)entityArea.clone(), tip, url);
    40
    entity.setIndex(k);
    94
    entity.setIndex(k);
    41
    entities.add(entity);
    95
    entities.add(entity);
    Precondition Violations (0)
    Row Violation