173-54-56

if (menuManager == null) { createMenuManager(); } return menuManager;
if (toolBarManager == null) { toolBarManager = new PaneToolBarManager(actionBar); } return toolBarManager;

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/common/ui/ViewerPane.java
Method name: `MenuManager getMenuManager()` |  | Method name: `ToolBarManager getToolBarManager()`
Number of AST nodes: 3 |  | Number of AST nodes: 3

1

    if (menuManager == null)↵

1

    if (toolBarManager == null)↵

2

        {↵

2

        {↵

3

          createMenuManager();↵

3

          toolBarManager = new PaneToolBarManager(actionBar);↵

4

        }↵

4

        }↵

5

        return menuManager;

5

        return toolBarManager;

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 declared in the same class
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.4
   Clone type | Type 2

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

   1

       if (menuManager == null)

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   menuManager | toolBarManager | VARIABLE_NAME_MISMATCH
   org.eclipse.jface.action.MenuManager | org.eclipse.jface.action.ToolBarManager | SUBCLASS_TYPE_MISMATCH

   1

       if (toolBarManager == null)

   2 | toolBarManager = new PaneToolBarManager(actionBar);

   Preondition Violations
   Unmatched statement toolBarManager=new PaneToolBarManager(actionBar); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   2

       toolBarManager = new PaneToolBarManager(actionBar);

   2

       createMenuManager();

   2 | createMenuManager();

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

   3

       return menuManager;

   3 | return menuManager;
   3 | return toolBarManager;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   menuManager | toolBarManager | VARIABLE_NAME_MISMATCH
   org.eclipse.jface.action.MenuManager | org.eclipse.jface.action.ToolBarManager | SUBCLASS_TYPE_MISMATCH

   3

       return toolBarManager;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Unmatched statement toolBarManager=new PaneToolBarManager(actionBar); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Unmatched statement createMenuManager(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted