1270-1-3

AxisLocation result = null; if (index < this.domainAxisLocations.size()) { result = (AxisLocation) this.domainAxisLocations.get(index); } if (result == null) { result = AxisLocation.getOpposite(getDomainAxisLocation(0)); } return result;
AxisLocation result = null; if (index < this.domainAxisLocations.size()) { result = (AxisLocation) this.domainAxisLocations.get(index); } if (result == null) { result = AxisLocation.getOpposite(getDomainAxisLocation()); } 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/chart/plot/XYPlot.java
Method name: `AxisLocation getDomainAxisLocation(int)` |  | Method name: `AxisLocation getDomainAxisLocation(int)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    AxisLocation result = null;↵

1

    AxisLocation result = null;↵

2

            if (index < this.domainAxisLocations.size()) {↵

2

            if (index < this.domainAxisLocations.size()) {↵

3

                result = (AxisLocation) this.domainAxisLocations.get(index);↵

3

                result = (AxisLocation) this.domainAxisLocations.get(index);↵

4

            }↵

4

            }↵

5

            if (result == null) {↵

5

            if (result == null) {↵

6

                result = AxisLocation.getOpposite(getDomainAxisLocation(0));↵

6

                result = AxisLocation.getOpposite(getDomainAxisLocation());↵

7

            }↵

7

            }↵

8

            return result;

8

            return result;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 17

1. {Refactorable}

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

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

   1

       AxisLocation result = null;

   1

       AxisLocation result = null;

   2

       if (index < this.domainAxisLocations.size())

   2

       if (index < this.domainAxisLocations.size())

   3

       result = (AxisLocation)this.domainAxisLocations.get(index);

   3

       result = (AxisLocation)this.domainAxisLocations.get(index);

   4

       if (result == null)

   4

       if (result == null)

   5

       result = AxisLocation.getOpposite(getDomainAxisLocation(0));

   5 | result = AxisLocation.getOpposite(getDomainAxisLocation(0));
   5 | result = AxisLocation.getOpposite(getDomainAxisLocation());

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getDomainAxisLocation(0) | getDomainAxisLocation() | ARGUMENT_NUMBER_MISMATCH

   5

       result = AxisLocation.getOpposite(getDomainAxisLocation());

   6

       return result;

   6

       return result;

   Precondition Violations (0)
   Row | Violation
   --- | ---