403-1-2

if (insets == null) { throw new IllegalArgumentException("Null 'insets' argument."); } if (paint == null) { throw new IllegalArgumentException("Null 'paint' argument."); } this.insets = insets; this.paint = paint;
if (dateFormatter == null) { throw new IllegalArgumentException( "Null 'dateFormatter' argument."); } if (numberFormatter == null) { throw new IllegalArgumentException( "Null 'numberFormatter' argument."); } this.dateFormatter = dateFormatter; this.numberFormatter = numberFormatter;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/BlockBorder.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/HighLowItemLabelGenerator.java
Method name: `void BlockBorder(RectangleInsets, Paint)` |  | Method name: `void HighLowItemLabelGenerator(DateFormat, NumberFormat)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (insets == null) {↵

1

    if (dateFormatter == null) {↵

2

                throw new IllegalArgumentException("Null 'insets↵

2

                throw new IllegalArgumentException(↵

3

    ' argument.");↵

3

                        "Null 'dateFormatter' argument.");   ↵

4

            }↵

4

            }↵

5

            if (paint == null) {↵

5

            if (numberFormatter == null) {↵

6

                throw new IllegalArgumentException("Null 'paint↵

6

                throw new IllegalArgumentException(↵

7

    ' argument.");   ↵

7

                        "Null 'numberFormatter' argument.");↵

8

            }↵

8

            }↵

9

            this.insets = insets;↵

9

            this.↵

10

            this.paint = paint↵

10

    dateFormatter = dateFormatter;↵

11

    ;

11

            this.numberFormatter = numberFormatter;

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.2
Clones location | Clones are in different classes
Number of node comparisons | 17

1. {Non-refactorable}

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

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

   1

       if (insets == null)

   1 | if (insets == null)
   1 | if (dateFormatter == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   insets | dateFormatter | VARIABLE_NAME_MISMATCH
   org.jfree.ui.RectangleInsets | java.text.DateFormat | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.text.DateFormat of variable dateFormatter
   - Make classes org.jfree.ui.RectangleInsets and java.text.DateFormat extend a common superclass

   1

       if (dateFormatter == null)

   2

       throw new IllegalArgumentException("Null 'insets' argument.");

   2 | throw new IllegalArgumentException("Null 'insets' argument.");
   2 | throw new IllegalArgumentException("Null 'dateFormatter' argument.");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Null 'insets' argument." | "Null 'dateFormatter' argument." | LITERAL_VALUE_MISMATCH

   2

       throw new IllegalArgumentException("Null 'dateFormatter' argument.");

   3

       if (paint == null)

   3 | if (paint == null)
   3 | if (numberFormatter == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   paint | numberFormatter | VARIABLE_NAME_MISMATCH
   java.awt.Paint | java.text.NumberFormat | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable paint does not match with type java.text.NumberFormat of variable numberFormatter
   - Make classes java.awt.Paint and java.text.NumberFormat extend a common superclass

   3

       if (numberFormatter == null)

   4

       throw new IllegalArgumentException("Null 'paint' argument.");

   4 | throw new IllegalArgumentException("Null 'paint' argument.");
   4 | throw new IllegalArgumentException("Null 'numberFormatter' argument.");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "Null 'paint' argument." | "Null 'numberFormatter' argument." | LITERAL_VALUE_MISMATCH

   4

       throw new IllegalArgumentException("Null 'numberFormatter' argument.");

   5

       this.dateFormatter = dateFormatter;

   5

       this.insets = insets;

   6

       this.numberFormatter = numberFormatter;

   6

       this.paint = paint;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type org.jfree.ui.RectangleInsets of variable insets does not match with type java.text.DateFormat of variable dateFormatter
   2 | Type java.awt.Paint of variable paint does not match with type java.text.NumberFormat of variable numberFormatter