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"); }
quid = quid.substring(1, quid.length() - 1); TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid); if (tableObj != null) { roseUtil.typeTable.put(eAttribute, tableObj.getName()); } else { warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{ quid, eAttribute.getName() })); roseUtil.typeTable.put(eAttribute, "String"); }
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 setEParameterProperties(RoseNode, EParameter) Method name: void setEAttributeProperties(RoseNode, EAttribute)
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(eParameter, tableObj.getName());
5
        roseUtil.typeTable.put(eAttribute, tableObj.getName());
6
      }
6
      }
7
      else
7
      else
8
      {
8
      {
9
        warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{
9
        warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object []{
10
          quid,
11
          eParameter.getEOperation().getName() }));
10
 quid, eAttribute.getName() }));
12
        roseUtil.typeTable.put(eParameter, "EObject");
11
        roseUtil.typeTable.put(eAttribute, "String");
13
      }
12
      }
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 statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    quid = quid.substring(1, quid.length() - 1);
    4
    quid = quid.substring(1, quid.length() - 1);
    5
    TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
    5
    TableObject tableObj = (TableObject)roseUtil.quidTable.get(quid);
    6
    if (tableObj != null)
    6
    if (tableObj != null)
    7
    roseUtil.typeTable.put(eParameter, tableObj.getName());
    7
    roseUtil.typeTable.put(eParameter, tableObj.getName());
    7
    roseUtil.typeTable.put(eAttribute, tableObj.getName());
    Differences
    Expression1Expression2Difference
    eParametereAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EParameterorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EParameter of variable eParameter does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EParameter and org.eclipse.emf.ecore.EAttribute extend a common superclass
    7
    roseUtil.typeTable.put(eAttribute, tableObj.getName());
    else
    else
                                                                                                                                                                                                                                                              
    8
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eAttribute.getName()}));
    8
    warning(RoseImporterPlugin.INSTANCE.getString("_UI_UnresolvedTypeIDFor_message", new Object[] {quid, eParameter.getEOperation().getName()}));
                                                                                                                                                                                                                                                                                              
    9
    roseUtil.typeTable.put(eParameter, "EObject");
    9
    roseUtil.typeTable.put(eParameter, "EObject");
    9
    roseUtil.typeTable.put(eAttribute, "String");
    Differences
    Expression1Expression2Difference
    eParametereAttributeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EParameterorg.eclipse.emf.ecore.EAttributeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EParameter of variable eParameter does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    • Make classes org.eclipse.emf.ecore.EParameter and org.eclipse.emf.ecore.EAttribute extend a common superclass
    9
    roseUtil.typeTable.put(eAttribute, "String");
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EParameter of variable eParameter does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute
    2Type org.eclipse.emf.ecore.EParameter of variable eParameter does not match with type org.eclipse.emf.ecore.EAttribute of variable eAttribute