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); // } }
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); }
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 contourRenderer(Graphics2D, Rectangle2D, PlotRenderingInfo, ContourPlot, ValueAxis, ValueAxis, ColorBar, ContourDataset, CrosshairState) Method name: void pointRenderer(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 = "";
2
                String tip = null;
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)) {
8
                String url = null;
6
                String url = null;
9
                // if (getURLGenerator() != null) {    //dmo: look at this later
7
                // if (getURLGenerator() != null) {   //dmo: look at this later
10
                //      url = getURLGenerator().generateURL(data, series, item);
8
                //   url = getURLGenerator().generateURL(data, series, item);
11
                // }
9
                // }
12
                // Unlike XYItemRenderer, we need to clone entityArea since it 
10
                // Unlike XYItemRenderer, we need to clone entityArea since it 
13
                // reused.
11
                // reused.
14
                ContourEntity entity = new ContourEntity(
12
                ContourEntity entity = new ContourEntity(
15
                        (Rectangle2D.Double) entityArea.clone(), tip, url);
13
                        (RectangularShape) entityArea.clone(), tip, url);
16
                entity.setIndex(k);
14
                entity.setIndex(k);
17
                entities.add(entity);
15
                entities.add(entity);
18
//              }
19
            }
16
            }
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)0.4
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)16.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    88
    if (entities != null)
    34
    if (entities != null)
    89
    String tip = "";
    89
    String tip = "";
    38
    String url = null;
    Differences
    Expression1Expression2Difference
    tipurlVARIABLE_NAME_MISMATCH
    ""nullTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted
    38
    String url = null;
    90
    if (getToolTipGenerator() != null)
    36
    if (getToolTipGenerator() != null)
    91
    tip = this.toolTipGenerator.generateToolTip(data, k);
    37
    tip = this.toolTipGenerator.generateToolTip(data, k);
    92
    String url = null;
    92
    String url = null;
    35
    String tip = null;
    Differences
    Expression1Expression2Difference
    urltipVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35
    String tip = null;
    93
    ContourEntity entity = new ContourEntity((Rectangle2D.Double)entityArea.clone(), tip, url);
    93
    ContourEntity entity = new ContourEntity((Rectangle2D.Double)entityArea.clone(), tip, url);
    39
    ContourEntity entity = new ContourEntity((RectangularShape)entityArea.clone(), tip, url);
    Differences
    Expression1Expression2Difference
    java.awt.geom.Rectangle2D.Doublejava.awt.geom.RectangularShapeSUBCLASS_TYPE_MISMATCH
    Rectangle2D.DoubleRectangularShapeTYPE_COMPATIBLE_REPLACEMENT
    java.awt.geom.Rectangle2D.Doublejava.awt.geom.RectangularShapeSUBCLASS_TYPE_MISMATCH
    39
    ContourEntity entity = new ContourEntity((RectangularShape)entityArea.clone(), tip, url);
    94
    entity.setIndex(k);
    40
    entity.setIndex(k);
    95
    entities.add(entity);
    41
    entities.add(entity);
    Precondition Violations (4)
    Row Violation
    1Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted