if (entities != null) { String tip = null; PieToolTipGenerator tipster = getToolTipGenerator(); if (tipster != null) { // @mgs: using the method's return value was missing tip = tipster.generateToolTip(dataset, currentKey); } String url = null; if (getURLGenerator() != null) { url = getURLGenerator().generateURL(dataset, currentKey, getPieIndex()); } PieSectionEntity entity = new PieSectionEntity( upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url); entities.add(entity); }
String tip = null; PieToolTipGenerator toolTipGenerator = getToolTipGenerator(); if (toolTipGenerator != null) { tip = toolTipGenerator.generateToolTip(dataset, key); } String url = null; PieURLGenerator urlGenerator = getURLGenerator(); if (urlGenerator != null) { url = urlGenerator.generateURL(dataset, key, getPieIndex()); } PieSectionEntity entity = new PieSectionEntity(path, dataset, getPieIndex(), section, key, tip, url); entities.add(entity);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/RingPlot.java
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo) Method name: void drawItem(Graphics2D, int, Rectangle2D, PiePlotState, int)
Number of AST nodes: 10 Number of AST nodes: 10
1
if (entities != null) {
2
                    String tip = null;
1
String tip = null;
3
                    PieToolTipGenerator tipster = getToolTipGenerator();
2
                        PieToolTipGenerator toolTipGenerator
3
 
4
                    if (tipster != null) {
4
                      
5
                        // @mgs: using the method's return value was missing 
5
          = getToolTipGenerator();
6
                        if (toolTipGenerator != null) {
6
                        tip = tipster.generateToolTip(dataset, currentK
7
                            tip = toolTipGenerator.generateToolTip(dataset, 
7
ey);
8
                                    key);
8
                    }
9
                    
10
    }
9
                    String url = null;
11
                        String url = null;
10
                    if (getURLGenerator()
12
                        PieURLGenerator urlGenerator = getURLGenerator();
11
 != null) {
13
                        if (urlGenerator != null) {
12
                        url = getURLGenerator().generateURL(dataset, currentKey,
14
                            url = urlGenerator.generateURL(dataset, key, 
13
                                getPieIndex());
15
                                    getPieIndex());
14
                    }
16
                    
17
    }
15
                    PieSectionEntity entity = new PieSectionEntity(
18
                        PieSectionEntity entity = new PieSectionEntity(path, 
16
                            upperArc, dataset, getPieIndex(), sectionIndex, 
19
                                dataset, getPieIndex(), section, key, tip, 
17
                            currentKey, tip, url);
20
                                url);
18
                    entities.add(entity);
21
                        entities.add(entity);
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 comparisons35
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)55.8
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    199
    String tip = null;
    58
    String tip = null;
    200
    PieToolTipGenerator tipster = getToolTipGenerator();
    200
    PieToolTipGenerator tipster = getToolTipGenerator();
    59
    PieToolTipGenerator toolTipGenerator = getToolTipGenerator();
    Differences
    Expression1Expression2Difference
    tipstertoolTipGeneratorVARIABLE_NAME_MISMATCH
    59
    PieToolTipGenerator toolTipGenerator = getToolTipGenerator();
    201
    if (tipster != null)
    201
    if (tipster != null)
    60
    if (toolTipGenerator != null)
    Differences
    Expression1Expression2Difference
    tipstertoolTipGeneratorVARIABLE_NAME_MISMATCH
    60
    if (toolTipGenerator != null)
    202
    tip = tipster.generateToolTip(dataset, currentKey);
    202
    tip = tipster.generateToolTip(dataset, currentKey);
    61
    tip = toolTipGenerator.generateToolTip(dataset, key);
    Differences
    Expression1Expression2Difference
    currentKeykeyVARIABLE_NAME_MISMATCH
    tipstertoolTipGeneratorVARIABLE_NAME_MISMATCH
    61
    tip = toolTipGenerator.generateToolTip(dataset, key);
    203
    String url = null;
    62
    String url = null;
                                                                                                          
    63
    PieURLGenerator urlGenerator = getURLGenerator();
    204
    if (getURLGenerator() != null)
    204
    if (getURLGenerator() != null)
    64
    if (urlGenerator != null)
    Differences
    Expression1Expression2Difference
    getURLGenerator()urlGeneratorTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression urlGenerator cannot be parameterized, because it has dependencies to/from statements that will be extracted
    64
    if (urlGenerator != null)
    205
    url = getURLGenerator().generateURL(dataset, currentKey, getPieIndex());
    205
    url = getURLGenerator().generateURL(dataset, currentKey, getPieIndex());
    65
    url = urlGenerator.generateURL(dataset, key, getPieIndex());
    Differences
    Expression1Expression2Difference
    currentKeykeyVARIABLE_NAME_MISMATCH
    getURLGenerator()urlGeneratorTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression urlGenerator cannot be parameterized, because it has dependencies to/from statements that will be extracted
    65
    url = urlGenerator.generateURL(dataset, key, getPieIndex());
    206
    PieSectionEntity entity = new PieSectionEntity(upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url);
    206
    PieSectionEntity entity = new PieSectionEntity(upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url);
    66
    PieSectionEntity entity = new PieSectionEntity(path, dataset, getPieIndex(), section, key, tip, url);
    Differences
    Expression1Expression2Difference
    upperArcpathVARIABLE_NAME_MISMATCH
    java.awt.geom.Arc2Djava.awt.geom.GeneralPathSUBCLASS_TYPE_MISMATCH
    sectionIndexsectionVARIABLE_NAME_MISMATCH
    currentKeykeyVARIABLE_NAME_MISMATCH
    66
    PieSectionEntity entity = new PieSectionEntity(path, dataset, getPieIndex(), section, key, tip, url);
    207
    entities.add(entity);
    67
    entities.add(entity);
    Precondition Violations (2)
    Row Violation
    1Expression urlGenerator cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression urlGenerator cannot be parameterized, because it has dependencies to/from statements that will be extracted