173-117-119

if (defaultURIConverter == null) { defaultURIConverter = new ExtensibleURIConverterImpl(); } return defaultURIConverter;
if (uriConverter == null) { uriConverter = new ExtensibleURIConverterImpl(); } return uriConverter;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceImpl.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/ResourceSetImpl.java
Method name: `URIConverter getDefaultURIConverter()` |  | Method name: `URIConverter getURIConverter()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (defaultURIConverter == null)↵

1

    if (uriConverter == null)↵

2

        {↵

2

        {↵

3

          defaultURIConverter = new ExtensibleURIConverterImpl();↵

3

          uriConverter = new ExtensibleURIConverterImpl();↵

4

        }↵

4

        }↵

5

        return defaultURIConverter;

5

        return uriConverter;

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 in different classes having the same super class
Number of node comparisons | 5

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 3
   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.2
   Clone type | Type 2

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

   1

       if (defaultURIConverter == null)

   1 | if (defaultURIConverter == null)
   1 | if (uriConverter == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   defaultURIConverter | uriConverter | VARIABLE_NAME_MISMATCH

   1

       if (uriConverter == null)

   2

       defaultURIConverter = new ExtensibleURIConverterImpl();

   2 | defaultURIConverter = new ExtensibleURIConverterImpl();
   2 | uriConverter = new ExtensibleURIConverterImpl();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   defaultURIConverter | uriConverter | VARIABLE_NAME_MISMATCH

   2

       uriConverter = new ExtensibleURIConverterImpl();

   3

       return defaultURIConverter;

   3 | return defaultURIConverter;
   3 | return uriConverter;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   defaultURIConverter | uriConverter | VARIABLE_NAME_MISMATCH

   3

       return uriConverter;

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