1250-1-16

CategoryAxis result = getDomainAxis(); Integer axisIndex = (Integer) this.datasetToDomainAxisMap.get(index); if (axisIndex != null) { result = getDomainAxis(axisIndex.intValue()); } return result;
Number result = null; BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject( rowKey, columnKey); if (item != null) { result = item.getMinOutlier(); } return result;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/DefaultBoxAndWhiskerCategoryDataset.java
Method name: `CategoryAxis getDomainAxisForDataset(int)` |  | Method name: `Number getMinOutlier(Comparable, Comparable)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    CategoryAxis result = getDomainAxis();↵

2

            Integer axisIndex = (Integer) this.datasetToDomainAxisMap.get(index↵

1

    Number result = null;↵

2

            BoxAndWhiskerItem item = (BoxAndWhiskerItem) this.data.getObject(↵

3

    );↵

3

                    rowKey, columnKey);↵

4

            if (axisIndex != null) {↵

4

            if (item != null) {↵

5

                result = getDomainAxis(axisIndex.intValue());↵

5

                result = item.getMinOutlier();↵

6

            }↵

6

            }↵

7

            return result;

7

            return result;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1
Clones location | Clones are in different classes
Number of node comparisons | 13

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 0.8
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       CategoryAxis result = getDomainAxis();

   2

       Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(index);

   2 | Integer axisIndex = (Integer)this.datasetToDomainAxisMap.get(index);
   1 | Number result = null;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   java.lang.Integer | java.lang.Number | SUBCLASS_TYPE_MISMATCH
   axisIndex | result | VARIABLE_NAME_MISMATCH
   java.lang.Integer | java.lang.Number | SUBCLASS_TYPE_MISMATCH
   (Integer)this.datasetToDomainAxisMap.get(index) | null | TYPE_COMPATIBLE_REPLACEMENT

   1

       Number result = null;

   2

       BoxAndWhiskerItem item = (BoxAndWhiskerItem)this.data.getObject(rowKey, columnKey);

   3

       if (axisIndex != null)

   3 | if (axisIndex != null)
   3 | if (item != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   axisIndex | item | VARIABLE_NAME_MISMATCH
   java.lang.Integer | org.jfree.data.statistics.BoxAndWhiskerItem | VARIABLE_TYPE_MISMATCH

   Preondition Violations
   Expression axisIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted

   Type java.lang.Integer of variable axisIndex does not match with type org.jfree.data.statistics.BoxAndWhiskerItem of variable item
   - Make classes java.lang.Integer and org.jfree.data.statistics.BoxAndWhiskerItem extend a common superclass

   3

       if (item != null)

   4

       result = item.getMinOutlier();

   4

       result = getDomainAxis(axisIndex.intValue());

   5

       return result;

   5

       return result;

   5 | return result;

   Preondition Violations
   Unmatched return result;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression axisIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Type java.lang.Integer of variable axisIndex does not match with type org.jfree.data.statistics.BoxAndWhiskerItem of variable item
   3 | Unmatched return result;
   4 | Clone fragment #1 returns variable axisIndex with type java.lang.Integer , while Clone fragment #2 returns variable result with type java.lang.Number