163-2-3

if (currentLineWidth > lineWidth) { addLine(); add(getAttributeIndent()); } else { add(" "); } add(name); add("=\""); add(value); add("\"");
if (currentLineWidth > lineWidth) { addLine(); add(getAttributeIndent()); } else { add(" "); } add(name); add("=\"");

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLString.java
Method name: `void addAttribute(String, String)` |  | Method name: `void startAttribute(String)`
Number of AST nodes: 8 |  | Number of AST nodes: 6

1

    if (currentLineWidth > lineWidth)↵

1

    if (currentLineWidth > lineWidth)↵

2

        {↵

2

        {↵

3

          addLine();↵

3

          addLine();↵

4

          add(getAttributeIndent());↵

4

          add(getAttributeIndent());↵

5

        }↵

5

        }↵

6

        else↵

6

        else↵

7

        {↵

7

        {↵

8

          add(" ");↵

8

          add(" ");↵

9

        }↵

9

        }↵

10

        add(name);↵

10

        add(name);↵

11

        add("=\"");↵

11

        add("=\"");

12

        add(value);↵

13

        add("\"");

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.1
Clones location | Clones are declared in the same class
Number of node comparisons | 24

1. {Refactorable}

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

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

   1

       if (currentLineWidth > lineWidth)

   1

       if (currentLineWidth > lineWidth)

   2

       addLine();

   2

       addLine();

   3

       add(getAttributeIndent());

   3

       add(getAttributeIndent());

       else

       else

   4

       add(" ");

   4

       add(" ");

   5

       add(name);

   5

       add(name);

   6

       add("=\"");

   6

       add("=\"");

   7

       add(value);

   8

       add("\"");

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