EntityCollection entities = state.getEntityCollection(); if (entities != null && hotspot != null) { String tip = null; XYToolTipGenerator generator = getToolTipGenerator( series, item ); if (generator != null) { tip = generator.generateToolTip(dataset, series, item); } String url = null; if (getURLGenerator() != null) { url = getURLGenerator().generateURL(dataset, series, item); } XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url); entities.add(entity); }
if (entities != null) { if (entityArea == null) { entityArea = line.getBounds(); } String tip = null; XYToolTipGenerator generator = getToolTipGenerator(series, item); if (generator != null) { tip = generator.generateToolTip(dataset, series, item); } String url = null; if (getURLGenerator() != null) { url = getURLGenerator().generateURL(dataset, series, item); } XYItemEntity entity = new XYItemEntity(entityArea, dataset, series, item, tip, url); entities.add(entity); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/YIntervalRenderer.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 11 Number of AST nodes: 12
1
EntityCollection entities = state.getEntityCollection();
1
if (entities != 
2
            if (entities != null && hotspot != null) {
3
    
2
null) {
3
            if (entityArea == null) {
4
                entityArea = line.getBounds();
5
            }
4
            String tip = null;
6
            String tip = null;
5
                XYToolTipGenerator generator = getToolTipGenerator(
7
            XYToolTipGenerator generator = getToolTipGenerator(
6
                    series, item
7
                );
8
    
8
series, item);
9
            if (generator != null) {
9
            if (generator != null) {
10
                    tip = generator.generateToolTip(dataset, series, item);
10
                tip = generator.generateToolTip(dataset, series, item);
11
                }
11
            }
12
                String url = null;
12
            String url = null;
13
                if (getURLGenerator() != null) {
13
            if (getURLGenerator() != null) {
14
                    url = getURLGenerator().generateURL(dataset, series, item);
14
                url = getURLGenerator().generateURL(dataset, series, item);
15
                }
15
            }
16
                XYItemEntity entity = new XYItemEntity(hotspot, dataset, 
16
            XYItemEntity entity = new XYItemEntity(entityArea, dataset, series,
17
                        series, item, tip, url);
17
                    item, tip, url);
18
                entities.add(entity);
18
            entities.add(entity);
19
            }
19
        }
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.5
Clones locationClones are in different classes having the same super class
Number of node comparisons48
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)48.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    58
    EntityCollection entities = state.getEntityCollection();
                                                                                                                        
    59
    if (entities != null && hotspot != null)
    59
    if (entities != null && hotspot != null)
    37
    if (entities != null)
    Differences
    Expression1Expression2Difference
    &&!=OPERATOR_MISMATCH
    entities != nullentitiesINFIX_LEFT_OPERAND_MISMATCH
    hotspot != nullnullINFIX_RIGHT_OPERAND_MISMATCH
    Preondition Violations
    Expression entities != null && hotspot != null cannot be parameterized, because it has dependencies to/from statements that will be extracted
    37
    if (entities != null)
                                                        
    38
    if (entityArea == null)
                                                                    
    39
    entityArea = line.getBounds();
    Preondition Violations
    Unmatched statement entityArea=line.getBounds(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    39
    entityArea = line.getBounds();
    60
    String tip = null;
    40
    String tip = null;
    61
    XYToolTipGenerator generator = getToolTipGenerator(series, item);
    41
    XYToolTipGenerator generator = getToolTipGenerator(series, item);
    62
    if (generator != null)
    42
    if (generator != null)
    63
    tip = generator.generateToolTip(dataset, series, item);
    43
    tip = generator.generateToolTip(dataset, series, item);
    64
    String url = null;
    44
    String url = null;
    65
    if (getURLGenerator() != null)
    45
    if (getURLGenerator() != null)
    66
    url = getURLGenerator().generateURL(dataset, series, item);
    46
    url = getURLGenerator().generateURL(dataset, series, item);
    67
    XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url);
    67
    XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url);
    47
    XYItemEntity entity = new XYItemEntity(entityArea, dataset, series, item, tip, url);
    Differences
    Expression1Expression2Difference
    hotspotentityAreaVARIABLE_NAME_MISMATCH
    java.awt.Polygonjava.awt.ShapeSUBCLASS_TYPE_MISMATCH
    47
    XYItemEntity entity = new XYItemEntity(entityArea, dataset, series, item, tip, url);
    68
    entities.add(entity);
    48
    entities.add(entity);
    Precondition Violations (2)
    Row Violation
    1Expression entities != null && hotspot != null cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement entityArea=line.getBounds(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted