1498-2-3

ModelImporter.EPackageImportInfo ePackageInfo = getEcoreImporter().getEPackageImportInfo(ePackage); if (ePackageInfo.getBasePackage() == null) { ePackageInfo.setBasePackage(packageInfo.base); } if (ePackageInfo.getPrefix() == null) { ePackageInfo.setPrefix(packageInfo.prefix); }
ModelImporter.EPackageImportInfo ePackageInfo = getJavaImporter().getEPackageImportInfo(ePackage); if (ePackageInfo.getBasePackage() == null) { ePackageInfo.setBasePackage(packageInfo.base); } if (ePackageInfo.getPrefix() == null) { ePackageInfo.setPrefix(packageInfo.prefix); }

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/ecore/EcoreImporterApplication.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/importer/java/JavaImporterApplication.java
Method name: `void traverseEPackages(List)` |  | Method name: `void traverseEPackages(List)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    ModelImporter.EPackageImportInfo ePackageInfo = getEcoreImporter().getEPackageImportInfo(ePackage);        ↵

1

    ModelImporter.EPackageImportInfo ePackageInfo = getJavaImporter().getEPackageImportInfo(ePackage);        ↵

2

              if (ePackageInfo.getBasePackage() == null)↵

2

              if (ePackageInfo.getBasePackage() == null)↵

3

              {↵

3

              {↵

4

                ePackageInfo.setBasePackage(packageInfo.base);↵

4

                ePackageInfo.setBasePackage(packageInfo.base);↵

5

              }↵

5

              }↵

6

              if (ePackageInfo.getPrefix() == null)↵

6

              if (ePackageInfo.getPrefix() == null)↵

7

              {↵

7

              {↵

8

                ePackageInfo.setPrefix(packageInfo.prefix);↵

8

                ePackageInfo.setPrefix(packageInfo.prefix);↵

9

              }

9

              }

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.4
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 16

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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.2
   Clone type | Type 2

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

   6

       ModelImporter.EPackageImportInfo ePackageInfo = getEcoreImporter().getEPackageImportInfo(ePackage);

   6 | ModelImporter.EPackageImportInfo ePackageInfo = getEcoreImporter().getEPackageImportInfo(ePackage);
   6 | ModelImporter.EPackageImportInfo ePackageInfo = getJavaImporter().getEPackageImportInfo(ePackage);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getEcoreImporter | getJavaImporter | METHOD_INVOCATION_NAME_MISMATCH

   6

       ModelImporter.EPackageImportInfo ePackageInfo = getJavaImporter().getEPackageImportInfo(ePackage);

   7

       if (ePackageInfo.getBasePackage() == null)

   7

       if (ePackageInfo.getBasePackage() == null)

   8

       ePackageInfo.setBasePackage(packageInfo.base);

   8 | ePackageInfo.setBasePackage(packageInfo.base);
   8 | ePackageInfo.setBasePackage(packageInfo.base);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo | org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo of variable packageInfo does not match with type org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo of variable packageInfo
   - Make classes org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo and org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo extend a common superclass

   8

       ePackageInfo.setBasePackage(packageInfo.base);

   9

       if (ePackageInfo.getPrefix() == null)

   9

       if (ePackageInfo.getPrefix() == null)

   10

       ePackageInfo.setPrefix(packageInfo.prefix);

   10 | ePackageInfo.setPrefix(packageInfo.prefix);
   10 | ePackageInfo.setPrefix(packageInfo.prefix);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo | org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo of variable packageInfo does not match with type org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo of variable packageInfo
   - Make classes org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo and org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo extend a common superclass

   10

       ePackageInfo.setPrefix(packageInfo.prefix);

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo of variable packageInfo does not match with type org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo of variable packageInfo
   2 | Type org.eclipse.emf.importer.ecore.EcoreImporterApplication.PackageInfo of variable packageInfo does not match with type org.eclipse.emf.importer.java.JavaImporterApplication.PackageInfo of variable packageInfo