2126-1-5

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);
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

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

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

      {↵

5

            classifierName = validName(upperCaseName(objectName));↵

6

              classifierName = validName(upperCaseName(objectName));↵

6

          }↵

7

          ↵

8

      }↵

7

          eClass.setName(classifierName);↵

9

            eClass.setName(classifierName);↵

8

          roseNode.setNode(eClass);↵

10

            roseNode.setNode(eClass);↵

9

          setEClassProperties(roseNode, eClass);

11

            setEClassProperties(roseNode, eClass);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3
Clones location | Clones are in the same method
Number of node comparisons | 18

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 1.6
   Clone type | Type 1

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

   91

       EClass eClass = EcoreFactory.eINSTANCE.createEClass();

   83

       EClass eClass = EcoreFactory.eINSTANCE.createEClass();

   92

       String classifierName = roseNode.getClassifierName();

   84

       String classifierName = roseNode.getClassifierName();

   93

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

   85

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

   94

       classifierName = validName(upperCaseName(objectName));

   86

       classifierName = validName(upperCaseName(objectName));

   95

       eClass.setName(classifierName);

   87

       eClass.setName(classifierName);

   96

       roseNode.setNode(eClass);

   88

       roseNode.setNode(eClass);

   97

       setEClassProperties(roseNode, eClass);

   89

       setEClassProperties(roseNode, eClass);

   Precondition Violations (0)
   Row | Violation
   --- | ---