1378-1-5

String type = element.getAttribute(ATT_TYPE); if (type == null) { logMissingAttribute(element, ATT_TYPE); } else if (element.getAttribute(ATT_CLASS) == null) { logMissingAttribute(element, ATT_CLASS);
String contentTypeIdentifier = element.getAttribute(ATT_CONTENT_TYPE_IDENTIFIER); if (contentTypeIdentifier == null) { logMissingAttribute(element, ATT_CONTENT_TYPE_IDENTIFIER); } else if (element.getAttribute(ATT_CLASS) == null) { logMissingAttribute(element, ATT_CLASS);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/plugin/ExtensionParserRegistryReader.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/plugin/ContentParserRegistryReader.java
Method name: `boolean readElement(IConfigurationElement, boolean)` |  | Method name: `boolean readElement(IConfigurationElement, boolean)`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    String type = element.getAttribute(ATT_TYPE);↵

1

    String contentTypeIdentifier = element.getAttribute(ATT_↵

2

          if (type↵

2

    CONTENT_TYPE_IDENTIFIER);↵

3

     == null)↵

3

          if (contentTypeIdentifier == null)↵

4

          {↵

4

          {↵

5

            logMissingAttribute(element, ATT_TYPE);↵

5

            logMissingAttribute(element, ATT_CONTENT_TYPE_IDENTIFIER);↵

6

          }↵

6

          }↵

7

          else if (element.getAttribute(ATT_CLASS) == null)↵

7

          else if (element.getAttribute(ATT_CLASS) == null)↵

8

          {↵

8

          {↵

9

            logMissingAttribute(element, ATT_CLASS);

9

            logMissingAttribute(element, ATT_CLASS);

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.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 13

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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) | 0.0
   Clone type | Type 2

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

   2

       String type = element.getAttribute(ATT_TYPE);

   2 | String type = element.getAttribute(ATT_TYPE);
   2 | String contentTypeIdentifier = element.getAttribute(ATT_CONTENT_TYPE_IDENTIFIER);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   type | contentTypeIdentifier | VARIABLE_NAME_MISMATCH
   ATT_TYPE | ATT_CONTENT_TYPE_IDENTIFIER | VARIABLE_NAME_MISMATCH

   2

       String contentTypeIdentifier = element.getAttribute(ATT_CONTENT_TYPE_IDENTIFIER);

   3

       if (type == null)

   3 | if (type == null)
   3 | if (contentTypeIdentifier == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   type | contentTypeIdentifier | VARIABLE_NAME_MISMATCH

   3

       if (contentTypeIdentifier == null)

   4

       logMissingAttribute(element, ATT_TYPE);

   4 | logMissingAttribute(element, ATT_TYPE);
   4 | logMissingAttribute(element, ATT_CONTENT_TYPE_IDENTIFIER);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ATT_TYPE | ATT_CONTENT_TYPE_IDENTIFIER | VARIABLE_NAME_MISMATCH

   4

       logMissingAttribute(element, ATT_CONTENT_TYPE_IDENTIFIER);

   5

       else if (element.getAttribute(ATT_CLASS) == null)

   5

       else if (element.getAttribute(ATT_CLASS) == null)

   6

       logMissingAttribute(element, ATT_CLASS);

   6

       logMissingAttribute(element, ATT_CLASS);

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