173-54-144

if (menuManager == null) { createMenuManager(); } return menuManager;
if (wildcards == null) { setWildcards(basicGetWildcards(eStructuralFeature)); } return wildcards;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/ViewerPane.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: `MenuManager getMenuManager()` |  | Method name: `List getWildcards()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (menuManager == null)↵

1

    if (wildcards == null)↵

2

        {↵

2

          {↵

3

          createMenuManager();↵

3

            setWildcards(basicGetWildcards(eStructuralFeature));↵

4

        }↵

4

        ↵

5

      }↵

5

        return menuManager;

6

          return wildcards;

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.1
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) | 4.5
   Clone type | Type 2

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

   1

       if (menuManager == null)

   1 | if (menuManager == null)
   1 | if (wildcards == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   menuManager | wildcards | VARIABLE_NAME_MISMATCH
   org.eclipse.jface.action.MenuManager | java.util.List | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.jface.action.MenuManager of variable menuManager does not match with type java.util.List<java.lang.String> of variable wildcards
   - Make classes org.eclipse.jface.action.MenuManager and java.util.List extend a common superclass

   1

       if (wildcards == null)

   2

       createMenuManager();

   2 | createMenuManager();
   2 | setWildcards(basicGetWildcards(eStructuralFeature));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   createMenuManager | setWildcards | METHOD_INVOCATION_NAME_MISMATCH
   createMenuManager() | setWildcards(basicGetWildcards(eStructuralFeature)) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations

   Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method createMenuManager

   Expression setWildcards(basicGetWildcards(eStructuralFeature)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression createMenuManager() is a void method call, and thus it cannot be parameterized
   Expression setWildcards(basicGetWildcards(eStructuralFeature)) is a void method call, and thus it cannot be parameterized

   Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   - Inline private method createMenuManager

   Expression setWildcards(basicGetWildcards(eStructuralFeature)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression createMenuManager() is a void method call, and thus it cannot be parameterized
   Expression setWildcards(basicGetWildcards(eStructuralFeature)) is a void method call, and thus it cannot be parameterized

   2

       setWildcards(basicGetWildcards(eStructuralFeature));

   3

       return wildcards;

   3

       return menuManager;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.jface.action.MenuManager of variable menuManager does not match with type java.util.List<java.lang.String> of variable wildcards
   2 | Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression setWildcards(basicGetWildcards(eStructuralFeature)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression createMenuManager() is a void method call, and thus it cannot be parameterized
   5 | Expression setWildcards(basicGetWildcards(eStructuralFeature)) is a void method call, and thus it cannot be parameterized
   6 | Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Expression setWildcards(basicGetWildcards(eStructuralFeature)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   8 | Expression createMenuManager() is a void method call, and thus it cannot be parameterized
   9 | Expression setWildcards(basicGetWildcards(eStructuralFeature)) is a void method call, and thus it cannot be parameterized