if (this.negativeItemLabelPosition != null) { return this.negativeItemLabelPosition; } // otherwise look up the position list ItemLabelPosition position = (ItemLabelPosition) this.negativeItemLabelPositionList.get(series); if (position == null) { position = this.baseNegativeItemLabelPosition; } return position;
if (this.itemURLGenerator != null) { return this.itemURLGenerator; } // otherwise look up the generator table CategoryURLGenerator generator = (CategoryURLGenerator) this.itemURLGeneratorList.get(series); if (generator == null) { generator = this.baseItemURLGenerator; } return generator;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java
Method name: ItemLabelPosition getSeriesNegativeItemLabelPosition(int) Method name: CategoryURLGenerator getSeriesItemURLGenerator(int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (this.negativeItemLabelPosition != null) {
1
if (this.itemURLGenerator != null) {
2
            return this.negativeItemLabelPosition;
2
            return this.itemURLGenerator;
3
        }
3
        }
4
        // otherwise look up the position list
4
        // otherwise look up the 
5
        ItemLabelPosition position = (ItemLabelPosition)
6
            this.negativeItemLabelPosition
5
generator table
6
        CategoryURLGenerator generator
7
List.get(series);
7
            = (CategoryURLGenerator) this.itemURLGeneratorList.get(series);
8
        if (position == null) {
8
        if (generator == null) {
9
            position = this.baseNegativeItemLabelPosition;
9
            generator = this.baseItemURLGenerator;
10
        }
10
        }
11
        return position;
11
        return generator;
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.negativeItemLabelPosition != null)
    1
    if (this.negativeItemLabelPosition != null)
    1
    if (this.itemURLGenerator != null)
    Differences
    Expression1Expression2Difference
    negativeItemLabelPositionitemURLGeneratorVARIABLE_NAME_MISMATCH
    org.jfree.chart.labels.ItemLabelPositionorg.jfree.chart.urls.CategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.labels.ItemLabelPosition of variable this.negativeItemLabelPosition does not match with type org.jfree.chart.urls.CategoryURLGenerator of variable this.itemURLGenerator
    • Make classes org.jfree.chart.labels.ItemLabelPosition and org.jfree.chart.urls.CategoryURLGenerator extend a common superclass
    1
    if (this.itemURLGenerator != null)
                                                                    
    2
    return this.itemURLGenerator;
    Preondition Violations
    Unmatched statement return this.itemURLGenerator; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return this.itemURLGenerator;
    2
    return this.itemURLGenerator;
    2
    return this.negativeItemLabelPosition;
    2
    return this.negativeItemLabelPosition;
    Preondition Violations
    Unmatched statement return this.negativeItemLabelPosition; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return this.negativeItemLabelPosition;
                                                                                      
                                                                                                                                                                                                
    3
    CategoryURLGenerator generator = (CategoryURLGenerator)this.itemURLGeneratorList.get(series);
    3
    ItemLabelPosition position = (ItemLabelPosition)this.negativeItemLabelPositionList.get(series);
                                                                                                                                                                                                    
    4
    if (position == null)
    4
    if (position == null)
    4
    if (generator == null)
    Differences
    Expression1Expression2Difference
    positiongeneratorVARIABLE_NAME_MISMATCH
    org.jfree.chart.labels.ItemLabelPositionorg.jfree.chart.urls.CategoryURLGeneratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.labels.ItemLabelPosition of variable position does not match with type org.jfree.chart.urls.CategoryURLGenerator of variable generator
    • Make classes org.jfree.chart.labels.ItemLabelPosition and org.jfree.chart.urls.CategoryURLGenerator extend a common superclass
    4
    if (generator == null)
                                                                                  
    5
    generator = this.baseItemURLGenerator;
    Preondition Violations
    Unmatched statement generator=this.baseItemURLGenerator; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    generator = this.baseItemURLGenerator;
    5
    position = this.baseNegativeItemLabelPosition;
    5
    position = this.baseNegativeItemLabelPosition;
    Preondition Violations
    Unmatched statement position=this.baseNegativeItemLabelPosition; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                  
                                            
    6
    return generator;
    Preondition Violations
    Unmatched return generator;
    6
    return generator;
    6
    return position;
    6
    return position;
    Preondition Violations
    Unmatched return position;
                                          
    Precondition Violations (11)
    Row Violation
    1Type org.jfree.chart.labels.ItemLabelPosition of variable this.negativeItemLabelPosition does not match with type org.jfree.chart.urls.CategoryURLGenerator of variable this.itemURLGenerator
    2Unmatched statement return this.itemURLGenerator; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return this.itemURLGenerator;
    4Unmatched statement return this.negativeItemLabelPosition; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return this.negativeItemLabelPosition;
    6Type org.jfree.chart.labels.ItemLabelPosition of variable position does not match with type org.jfree.chart.urls.CategoryURLGenerator of variable generator
    7Unmatched statement generator=this.baseItemURLGenerator; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement position=this.baseNegativeItemLabelPosition; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched return generator;
    10Unmatched return position;
    11The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero