File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/util/XMLProcessor.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/util/XMLProcessor.java | |||
Method name: Resource load(InputSource, Map,?>)
|
Method name: Resource load(InputStream, Map,?>)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | ResourceSet resourceSet = createResourceSet();↵ | 1 | ResourceSet resourceSet = createResourceSet();↵ | |
2 | XMLResource resource = (XMLResource)resourceSet.createResource(XML_URI);↵ | 2 | Resource resource = resourceSet.createResource(XML_URI);↵ | |
3 | if (options != null)↵ | 3 | if (options != null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | Map<Object, Object> mergedOptions = new HashMap<Object, Object>(loadOptions);↵ | 5 | Map<Object, Object> mergedOptions = new HashMap<Object, Object>(loadOptions);↵ | |
6 | mergedOptions.putAll(options);↵ | 6 | mergedOptions.putAll(options);↵ | |
7 | resource.load(inputSource, mergedOptions);↵ | 7 | resource.load(is, mergedOptions);↵ | |
8 | }↵ | 8 | }↵ | |
9 | else↵ | 9 | else↵ | |
10 | {↵ | 10 | {↵ | |
11 | resource.load(inputSource, loadOptions);↵ | 11 | resource.load(is, loadOptions);↵ | |
12 | }↵ | 12 | }↵ | |
13 | resourceSet.getPackageRegistry().putAll(registry);↵ | 13 | resourceSet.getPackageRegistry().putAll(registry);↵ | |
14 | return resource; | 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 | 37 |
Number of mapped statements | 7 |
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) | 2.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ResourceSet resourceSet = createResourceSet(); | 1 | ResourceSet resourceSet = createResourceSet(); | |||||||||||||||||||
|
| 2 | Resource resource = resourceSet.createResource(XML_URI); | |||||||||||||||||||
2 | XMLResource resource = (XMLResource)resourceSet.createResource(XML_URI); |
| | |||||||||||||||||||
3 | if (options != null) |
| 3 | if (options != null) | ||||||||||||||||||
4 | Map<Object, Object> mergedOptions = new HashMap<Object, Object>(loadOptions); | 4 | Map<Object, Object> mergedOptions = new HashMap<Object, Object>(loadOptions); | |||||||||||||||||||
5 | mergedOptions.putAll(options); |
| 5 | mergedOptions.putAll(options); | ||||||||||||||||||
6 | resource.load(inputSource, mergedOptions); |
| 6 | resource.load(is, mergedOptions); | ||||||||||||||||||
else | else | |||||||||||||||||||||
7 | resource.load(inputSource, loadOptions); |
| 7 | resource.load(is, loadOptions); | ||||||||||||||||||
8 | resourceSet.getPackageRegistry().putAll(registry); | 8 | resourceSet.getPackageRegistry().putAll(registry); | |||||||||||||||||||
|
| 9 | return resource; | |||||||||||||||||||
9 | return resource; |
| |
Row | Violation |
---|---|
1 | Unmatched statement Resource resource=resourceSet.createResource(XML_URI); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement XMLResource resource=(XMLResource)resourceSet.createResource(XML_URI); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options |
4 | Type java.util.Map<,> of variable options does not match with type java.util.Map<,> of variable options |
5 | Type org.xml.sax.InputSource of variable inputSource does not match with type java.io.InputStream of variable is |
6 | Type org.eclipse.emf.ecore.xmi.XMLResource of variable resource does not match with type org.eclipse.emf.ecore.resource.Resource of variable resource |
7 | Type org.xml.sax.InputSource of variable inputSource does not match with type java.io.InputStream of variable is |
8 | Type org.eclipse.emf.ecore.xmi.XMLResource of variable resource does not match with type org.eclipse.emf.ecore.resource.Resource of variable resource |
9 | Unmatched return resource; |
10 | Unmatched return resource; |