173-102-146

if (extensions == null) { extensions = new ArrayList<String>(); } return extensions;
if (pattern == null) { setPatternFacet(basicGetPatternFacet(eDataType)); } return pattern;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/ui/contribution/ModelImporterManager.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: `List getExtensions()` |  | Method name: `List getPatternFacet()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (extensions == null)↵

1

    if (pattern == null)↵

2

          {↵

2

          {↵

3

            extensions = new ArrayList<String>();↵

3

            setPatternFacet(basicGetPatternFacet(eDataType));↵

4

          }↵

4

          }↵

5

          return extensions;

5

          return pattern;

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 | 5

1. {Non-refactorable}

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

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

   1

       if (extensions == null)

   1 | if (extensions == null)
   1 | if (pattern == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   extensions | pattern | VARIABLE_NAME_MISMATCH

   1

       if (pattern == null)

   2 | setPatternFacet(basicGetPatternFacet(eDataType));

   Preondition Violations
   Unmatched statement setPatternFacet(basicGetPatternFacet(eDataType)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   2

       setPatternFacet(basicGetPatternFacet(eDataType));

   2

       extensions = new ArrayList<String>();

   2 | extensions = new ArrayList<String>();

   Preondition Violations
   Unmatched statement extensions=new ArrayList<String>(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   3

       return extensions;

   3 | return extensions;
   3 | return pattern;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   extensions | pattern | VARIABLE_NAME_MISMATCH

   3

       return pattern;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Unmatched statement setPatternFacet(basicGetPatternFacet(eDataType)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Unmatched statement extensions=new ArrayList<String>(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted