File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/PlatformResourceURIHandlerImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/PlatformResourceURIHandlerImpl.java | |||
Method name: InputStream createInputStream(URI, Map,?>)
|
Method name: OutputStream createOutputStream(URI, Map,?>)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | String platformResourcePath = uri.toPlatformString(true);↵ | 1 | String platformResourcePath = uri.toPlatformString(true);↵ | |
2 | if (workspaceRoot != null)↵ | 2 | if (workspaceRoot != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath, options);↵ | 4 | return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath, options);↵ | |
5 | }↵ | 5 | }↵ | |
6 | else↵ | 6 | else↵ | |
7 | {↵ | 7 | {↵ | |
8 | URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);↵ | 8 | URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath);↵ | |
9 | if (resolvedLocation != null)↵ | 9 | if (resolvedLocation != null)↵ | |
10 | {↵ | 10 | {↵ | |
11 | return getURIConverter(options).createInputStream(resolvedLocation, options);↵ | 11 | return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options);↵ | |
12 | }↵ | 12 | }↵ | |
13 | throw new IOException("The path '" + platformResourcePath + "' is unmapped");↵ | 13 | throw new IOException("The path '" + platformResourcePath + "' is unmapped");↵ | |
14 | } | 14 |
| |
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) | 0.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 21 |
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) | 0.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||
---|---|---|---|---|---|---|---|---|
1 | String platformResourcePath = uri.toPlatformString(true); | 1 | String platformResourcePath = uri.toPlatformString(true); | |||||
2 | if (workspaceRoot != null) | 2 | if (workspaceRoot != null) | |||||
|
| 3 | return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath, options); | |||||
3 | return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath, options); |
| | |||||
else | else | |||||||
4 | URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); | 4 | URI resolvedLocation = EcorePlugin.resolvePlatformResourcePath(platformResourcePath); | |||||
5 | if (resolvedLocation != null) | 5 | if (resolvedLocation != null) | |||||
|
| 6 | return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation, options); | |||||
6 | return getURIConverter(options).createInputStream(resolvedLocation, options); |
| | |||||
7 | throw new IOException("The path '" + platformResourcePath + "' is unmapped"); | 7 | throw new IOException("The path '" + platformResourcePath + "' is unmapped"); |
Row | Violation |
---|---|
1 | Unmatched statement return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return WorkbenchHelper.createPlatformResourceOutputStream(platformResourcePath,options); |
3 | Unmatched statement return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return WorkbenchHelper.createPlatformResourceInputStream(platformResourcePath,options); |
5 | Unmatched statement return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
6 | Unmatched return ((URIConverter)options.get(URIConverter.OPTION_URI_CONVERTER)).createOutputStream(resolvedLocation,options); |
7 | Unmatched statement return getURIConverter(options).createInputStream(resolvedLocation,options); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
8 | Unmatched return getURIConverter(options).createInputStream(resolvedLocation,options); |
9 | Clone fragment #1 returns variables platformResourcePath, resolvedLocation , while Clone fragment #2 returns variables platformResourcePath, resolvedLocation |