11566-2-3

packageInfo.nsURI = arguments[++index]; if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) { packageInfo.base = arguments[++index]; if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) { packageInfo.prefix = arguments[++index]; } }
packageInfo.nsURI = arguments[++index]; if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) { packageInfo.base = arguments[++index]; if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) { packageInfo.prefix = arguments[++index]; } }

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: `int processPackageInformation(String[], int, Map)` |  | Method name: `int processPackageInformation(String[], int, Map)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    packageInfo.nsURI = arguments[++index];↵

1

    packageInfo.nsURI = arguments[++index];↵

2

          if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵

2

          if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵

3

          {↵

3

          {↵

4

            packageInfo.base = arguments[++index];↵

4

            packageInfo.base = arguments[++index];↵

5

            if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵

5

            if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵

6

            {↵

6

            {↵

7

              packageInfo.prefix = arguments[++index];↵

7

              packageInfo.prefix = arguments[++index];↵

8

            }↵

8

            }↵

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

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) | 0.7
   Clone type | Type 2

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

   4

       packageInfo.nsURI = arguments[++index];

   4 | packageInfo.nsURI = arguments[++index];
   4 | packageInfo.nsURI = arguments[++index];

   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

   4

       packageInfo.nsURI = arguments[++index];

   5

       if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))

   5

       if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))

   6

       packageInfo.base = arguments[++index];

   6 | packageInfo.base = arguments[++index];
   6 | packageInfo.base = arguments[++index];

   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

   6

       packageInfo.base = arguments[++index];

   7

       if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))

   7

       if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))

   8

       packageInfo.prefix = arguments[++index];

   8 | packageInfo.prefix = arguments[++index];
   8 | packageInfo.prefix = arguments[++index];

   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

       packageInfo.prefix = arguments[++index];

   Precondition Violations (3)
   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
   3 | 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