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: 14 | Number of AST nodes: 14 | |||
1 | int start = index;↵ | 1 | int start = index;↵ | |
2 | PackageInfo packageInfo = new PackageInfo();↵ | 2 | PackageInfo packageInfo = new PackageInfo();↵ | |
3 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | 3 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | |
4 | {↵ | 4 | {↵ | |
5 | packageInfo.nsURI = arguments[++index];↵ | 5 | packageInfo.nsURI = arguments[++index];↵ | |
6 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | 6 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | |
7 | {↵ | 7 | {↵ | |
8 | packageInfo.base = arguments[++index];↵ | 8 | packageInfo.base = arguments[++index];↵ | |
9 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | 9 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-"))↵ | |
10 | {↵ | 10 | {↵ | |
11 | packageInfo.prefix = arguments[++index];↵ | 11 | packageInfo.prefix = arguments[++index];↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | if (index - start != 1 && index - start != 3)↵ | 14 | if (index - start != 1 && index - start != 3)↵ | |
15 | {↵ | 15 | {↵ | |
16 | throw new IllegalArgumentException("Error: Expecting either 1 or 3 arguments for " + arguments[start]);↵ | 16 | throw new IllegalArgumentException("Error: Expecting either 1 or 3 arguments for " + arguments[start]);↵ | |
17 | }↵ | 17 | }↵ | |
18 | else↵ | 18 | else↵ | |
19 | {↵ | 19 | {↵ | |
20 | nsURIToPackageInfo.put(packageInfo.nsURI, packageInfo);↵ | 20 | nsURIToPackageInfo.put(packageInfo.nsURI, packageInfo);↵ | |
21 | nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(), packageInfo);↵ | 21 | nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(), packageInfo);↵ | |
22 | return index;↵ | 22 | return index;↵ | |
23 | }↵ | 23 | }↵ | |
24 | }↵ | 24 | }↵ | |
25 | else↵ | 25 | else↵ | |
26 | {↵ | 26 | {↵ | |
27 | throw new IllegalArgumentException("Error: No package name was specified for " + arguments[start]);↵ | 27 | throw new IllegalArgumentException("Error: No package name was specified for " + arguments[start]);↵ | |
28 | } | 28 |
| |
See real code fragment | See real code fragment |
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) | 1.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 46 |
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int start = index; | 1 | int start = index; | ||||||||||||
| 2 | PackageInfo packageInfo = new PackageInfo(); | |||||||||||||
2 | PackageInfo packageInfo = new PackageInfo(); | | |||||||||||||
3 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) | 3 | if (index + 1 < arguments.length && !arguments[index + 1].startsWith("-")) | ||||||||||||
4 | packageInfo.nsURI = arguments[++index]; |
| 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]; | |||||||||||
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]; | |||||||||||
9 | if (index - start != 1 && index - start != 3) | 9 | if (index - start != 1 && index - start != 3) | ||||||||||||
10 | throw new IllegalArgumentException("Error: Expecting either 1 or 3 arguments for " + arguments[start]); | 10 | throw new IllegalArgumentException("Error: Expecting either 1 or 3 arguments for " + arguments[start]); | ||||||||||||
else | else | ||||||||||||||
|
| 11 | nsURIToPackageInfo.put(packageInfo.nsURI, packageInfo); | ||||||||||||
11 | nsURIToPackageInfo.put(packageInfo.nsURI, packageInfo); |
| | ||||||||||||
|
| 12 | nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(), packageInfo); | ||||||||||||
12 | nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(), packageInfo); |
| | ||||||||||||
13 | return index; | 13 | return index; | ||||||||||||
else | else | ||||||||||||||
14 | throw new IllegalArgumentException("Error: No package name was specified for " + arguments[start]); | 14 | throw new IllegalArgumentException("Error: No package name was specified for " + arguments[start]); |
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 |
4 | Unmatched statement nsURIToPackageInfo.put(packageInfo.nsURI,packageInfo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement nsURIToPackageInfo.put(packageInfo.nsURI,packageInfo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(),packageInfo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched statement nsURIToPackageInfo.put(packageInfo.nsURI.toLowerCase(),packageInfo); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |