2126-2-5

EDataType eDataType = EcoreFactory.eINSTANCE.createEDataType(); String classifierName = roseNode.getClassifierName(); if (classifierName == null || classifierName.length() == 0) { classifierName = validName(upperCaseName(objectName)); } eDataType.setName(classifierName); roseNode.setNode(eDataType); setEDataTypeProperties(roseNode, eDataType);
EClass eClass = EcoreFactory.eINSTANCE.createEClass(); String classifierName = roseNode.getClassifierName(); if (classifierName == null || classifierName.length() == 0) { classifierName = validName(upperCaseName(objectName)); } eClass.setName(classifierName); roseNode.setNode(eClass); setEClassProperties(roseNode, eClass);

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 visitClass(RoseNode, String, String, String, Object)` |  | Method name: `void visitClass(RoseNode, String, String, String, Object)`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    EDataType eDataType = EcoreFactory.eINSTANCE.createEDataType();↵

1

    EClass eClass = EcoreFactory.eINSTANCE.createEClass();↵

2

            String classifierName = roseNode.getClassifierName();↵

2

            String classifierName = roseNode.getClassifierName();↵

3

            if (classifierName == null || classifierName.length() == 0)↵

3

            if (classifierName == null || classifierName.length() == 0)↵

4

            {↵

4

            {↵

5

              classifierName = validName(upperCaseName(objectName));↵

5

              classifierName = validName(upperCaseName(objectName));↵

6

            }↵

6

            }↵

7

            eDataType.setName(classifierName);↵

7

            eClass.setName(classifierName);↵

8

            roseNode.setNode(eDataType);↵

8

            roseNode.setNode(eClass);↵

9

            setEDataTypeProperties(roseNode, eDataType);

9

            setEClassProperties(roseNode, eClass);

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.2
Clones location | Clones are in the same method
Number of node comparisons | 25

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   Number of unmapped statements in the first code fragment | 2
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 1.5
   Clone type | Type 2

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

   32

       EDataType eDataType = EcoreFactory.eINSTANCE.createEDataType();

   83

       EClass eClass = EcoreFactory.eINSTANCE.createEClass();

   33

       String classifierName = roseNode.getClassifierName();

   84

       String classifierName = roseNode.getClassifierName();

   34

       if (classifierName == null || classifierName.length() == 0)

   85

       if (classifierName == null || classifierName.length() == 0)

   35

       classifierName = validName(upperCaseName(objectName));

   86

       classifierName = validName(upperCaseName(objectName));

   36

       eDataType.setName(classifierName);

   36 | eDataType.setName(classifierName);
   87 | eClass.setName(classifierName);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eDataType | eClass | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.EDataType | org.eclipse.emf.ecore.EClass | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.EDataType of variable eDataType does not match with type org.eclipse.emf.ecore.EClass of variable eClass
   - Make classes org.eclipse.emf.ecore.EDataType and org.eclipse.emf.ecore.EClass extend a common superclass

   87

       eClass.setName(classifierName);

   37

       roseNode.setNode(eDataType);

   37 | roseNode.setNode(eDataType);
   88 | roseNode.setNode(eClass);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   eDataType | eClass | VARIABLE_NAME_MISMATCH
   org.eclipse.emf.ecore.EDataType | org.eclipse.emf.ecore.EClass | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.EDataType of variable eDataType does not match with type org.eclipse.emf.ecore.EClass of variable eClass
   - Make classes org.eclipse.emf.ecore.EDataType and org.eclipse.emf.ecore.EClass extend a common superclass

   88

       roseNode.setNode(eClass);

   38

       setEDataTypeProperties(roseNode, eDataType);

   89

       setEClassProperties(roseNode, eClass);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.EDataType of variable eDataType does not match with type org.eclipse.emf.ecore.EClass of variable eClass
   2 | Type org.eclipse.emf.ecore.EDataType of variable eDataType does not match with type org.eclipse.emf.ecore.EClass of variable eClass