if (menuManager == null) { createMenuManager(); } return menuManager;
if (enumerationLiterals == null) { setEnumerationFacet(basicGetEnumerationFacet(eDataType)); } return enumerationLiterals;
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 getEnumerationFacet()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (menuManager == null)
1
if (enumerationLiterals == null)
2
    {
2
      {
3
      createMenuManager();
3
        setEnumerationFacet(basicGetEnumerationFacet(eDataType));
4
    }
4
      }
5
    return menuManager;
5
      return enumerationLiterals;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)3.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (menuManager == null)
    1
    if (menuManager == null)
    1
    if (enumerationLiterals == null)
    Differences
    Expression1Expression2Difference
    menuManagerenumerationLiteralsVARIABLE_NAME_MISMATCH
    org.eclipse.jface.action.MenuManagerjava.util.ListVARIABLE_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 enumerationLiterals
    • Make classes org.eclipse.jface.action.MenuManager and java.util.List extend a common superclass
    1
    if (enumerationLiterals == null)
    2
    createMenuManager();
    2
    createMenuManager();
    2
    setEnumerationFacet(basicGetEnumerationFacet(eDataType));
    Differences
    Expression1Expression2Difference
    createMenuManagersetEnumerationFacetMETHOD_INVOCATION_NAME_MISMATCH
    createMenuManager()setEnumerationFacet(basicGetEnumerationFacet(eDataType))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 setEnumerationFacet(basicGetEnumerationFacet(eDataType)) 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 setEnumerationFacet(basicGetEnumerationFacet(eDataType)) 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 setEnumerationFacet(basicGetEnumerationFacet(eDataType)) 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 setEnumerationFacet(basicGetEnumerationFacet(eDataType)) is a void method call, and thus it cannot be parameterized
    2
    setEnumerationFacet(basicGetEnumerationFacet(eDataType));
                                                                
    3
    return enumerationLiterals;
    3
    return menuManager;
                                                
    Precondition Violations (9)
    Row Violation
    1Type org.eclipse.jface.action.MenuManager of variable menuManager does not match with type java.util.List<java.lang.String> of variable enumerationLiterals
    2Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression setEnumerationFacet(basicGetEnumerationFacet(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression createMenuManager() is a void method call, and thus it cannot be parameterized
    5Expression setEnumerationFacet(basicGetEnumerationFacet(eDataType)) is a void method call, and thus it cannot be parameterized
    6Expression createMenuManager() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression setEnumerationFacet(basicGetEnumerationFacet(eDataType)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression createMenuManager() is a void method call, and thus it cannot be parameterized
    9Expression setEnumerationFacet(basicGetEnumerationFacet(eDataType)) is a void method call, and thus it cannot be parameterized