if (series < getListCount()) { List tooltips = (List) this.toolTipSeries.get(series); if (tooltips != null) { if (item < tooltips.size()) { result = (String) tooltips.get(item); } } }
if (series < getListCount()) { List urls = (List) this.urlSeries.get(series); if (urls != null) { if (item < urls.size()) { result = (String) urls.get(item); } } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/CustomXYToolTipGenerator.java File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/CustomXYURLGenerator.java
Method name: String getToolTipText(int, int) Method name: String getURL(int, int)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (series < getListCount()) {
1
if (series < getListCount()) {
2
            List tooltips = (List) this.toolTipSeries.get(series);
2
            List urls = (List) this.urlSeries.get(series);
3
            if (tooltips != null) {
3
            if (urls != null) {
4
                if (item < tooltips.size()) {
4
                if (item < urls.size()) {
5
                    result = (String) tooltips.get(item);
5
                    result = (String) urls.get(item);
6
                }
6
                }
7
            }
7
            }
8
        }
8
        }
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.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (series < getListCount())
    2
    if (series < getListCount())
                                                                                                
    3
    List urls = (List)this.urlSeries.get(series);
    Preondition Violations
    Unmatched statement List urls=(List)this.urlSeries.get(series); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    List urls = (List)this.urlSeries.get(series);
    3
    List tooltips = (List)this.toolTipSeries.get(series);
    3
    List tooltips = (List)this.toolTipSeries.get(series);
    Preondition Violations
    Unmatched statement List tooltips=(List)this.toolTipSeries.get(series); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                
    4
    if (tooltips != null)
    4
    if (tooltips != null)
    4
    if (urls != null)
    Differences
    Expression1Expression2Difference
    tooltipsurlsVARIABLE_NAME_MISMATCH
    4
    if (urls != null)
    5
    if (item < tooltips.size())
    5
    if (item < tooltips.size())
    5
    if (item < urls.size())
    Differences
    Expression1Expression2Difference
    tooltipsurlsVARIABLE_NAME_MISMATCH
    5
    if (item < urls.size())
    6
    result = (String)tooltips.get(item);
    6
    result = (String)tooltips.get(item);
    6
    result = (String)urls.get(item);
    Differences
    Expression1Expression2Difference
    tooltipsurlsVARIABLE_NAME_MISMATCH
    6
    result = (String)urls.get(item);
    Precondition Violations (2)
    Row Violation
    1Unmatched statement List urls=(List)this.urlSeries.get(series); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement List tooltips=(List)this.toolTipSeries.get(series); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted