quid = quid.substring(1, quid.length() - 1); TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid); if (tableObj != null) { roseUtil.typeTable.put(eOperation, tableObj.getName()); } else { warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{ quid, eOperation.getName() })); roseUtil.typeTable.put(eOperation, "EString"); }
quid = quid.substring(1, quid.length() - 1); TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid); if (tableObj != null) { roseUtil.typeTable.put(eParameter, tableObj.getName()); } else { warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{ quid, eParameter.getEOperation().getName() })); roseUtil.typeTable.put(eParameter, "EObject"); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseEcoreBuilder.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseEcoreBuilder.java
Method name: void setResultType(RoseNode, EOperation) Method name: void setEParameterProperties(RoseNode, EParameter)
Number of AST nodes: 6 Number of AST nodes: 6
1
quid = quid.substring(1, quid.length() - 1);
1
quid = quid.substring(1, quid.length() - 1);
2
      TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
2
      TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
3
      if (tableObj != null)
3
      if (tableObj != null)
4
      {
4
      {
5
        roseUtil.typeTable.put(eOperation, tableObj.getName());
5
        roseUtil.typeTable.put(eParameter, tableObj.getName());
6
      }
6
      }
7
      else
7
      else
8
      {
8
      {
9
        warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{ quid, e
9
        warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{
10
          quid,
10
Operation.getName() }));
11
          eParameter.getEOperation().getName() }));
11
        roseUtil.typeTable.put(eOperation, "EString");
12
        roseUtil.typeTable.put(eParameter, "EObject");
12
      }
13
      }
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.3
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    quid = quid.substring(1, quid.length() - 1);
    4
    quid = quid.substring(1, quid.length() - 1);
    4
    TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
    5
    TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
    5
    if (tableObj != null)
    6
    if (tableObj != null)
    6
    roseUtil.typeTable.put(eOperation, tableObj.getName());
    6
    roseUtil.typeTable.put(eOperation, tableObj.getName());
    7
    roseUtil.typeTable.put(eParameter, tableObj.getName());
    Differences
    Expression1Expression2Difference
    eOperationeParameterVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EOperationorg.eclipse.emf.ecore.EParameterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EOperation of variable eOperation does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    • Make classes org.eclipse.emf.ecore.EOperation and org.eclipse.emf.ecore.EParameter extend a common superclass
    7
    roseUtil.typeTable.put(eParameter, tableObj.getName());
    else
    else
    7
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eOperation.getName()}));
    7
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eOperation.getName()}));
    8
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eParameter.getEOperation().getName()}));
    Differences
    Expression1Expression2Difference
    eOperationeParameter.getEOperation()TYPE_COMPATIBLE_REPLACEMENT
    8
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eParameter.getEOperation().getName()}));
    8
    roseUtil.typeTable.put(eOperation, "EString");
    8
    roseUtil.typeTable.put(eOperation, "EString");
    9
    roseUtil.typeTable.put(eParameter, "EObject");
    Differences
    Expression1Expression2Difference
    eOperationeParameterVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EOperationorg.eclipse.emf.ecore.EParameterVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EOperation of variable eOperation does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    • Make classes org.eclipse.emf.ecore.EOperation and org.eclipse.emf.ecore.EParameter extend a common superclass
    9
    roseUtil.typeTable.put(eParameter, "EObject");
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EOperation of variable eOperation does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter
    2Type org.eclipse.emf.ecore.EOperation of variable eOperation does not match with type org.eclipse.emf.ecore.EParameter of variable eParameter