File path: /emf-2.4.1/src/org/eclipse/emf/ecore/plugin/ContentParserRegistryReader.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/plugin/ProtocolParserRegistryReader.java | |||
Method name: boolean readElement(IConfigurationElement, boolean)
|
Method name: boolean readElement(IConfigurationElement, boolean)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (add)↵ | 1 | if (add)↵ | |
2 | {↵ | 2 | {↵ | |
3 | Object previous = Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap().put(contentTypeIdentifier, new ResourceFactoryDescriptor(element, ATT_CLASS));↵ | 3 | Object previous = Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put(protocolName, new ResourceFactoryDescriptor(element, ATT_CLASS));↵ | |
4 | if (previous instanceof ResourceFactoryDescriptor)↵ | 4 | if (previous instanceof ResourceFactoryDescriptor)↵ | |
5 | {↵ | 5 | {↵ | |
6 | ResourceFactoryDescriptor descriptor = (ResourceFactoryDescriptor)previous;↵ | 6 | ResourceFactoryDescriptor descriptor = (ResourceFactoryDescriptor)previous;↵ | |
7 | EcorePlugin.INSTANCE.log↵ | 7 | EcorePlugin.INSTANCE.log↵ | |
8 | ("Both '" + descriptor.element.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register a content parser for '" + contentTypeIdentifier + "'");↵ | 8 | ("Both '" + descriptor.element.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register a protocol parser for '" + protocolName + "'");↵ | |
9 | }↵ | 9 | }↵ | |
10 | return true;↵ | 10 | return true;↵ | |
11 | }↵ | 11 | }↵ | |
12 | else↵ | 12 | else↵ | |
13 | {↵ | 13 | {↵ | |
14 | Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap().remove(contentTypeIdentifier);↵ | 14 | Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().remove(protocolName);↵ | |
15 | return true;↵ | 15 | return true;↵ | |
16 | } | 16 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 35 |
Number of mapped statements | 8 |
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) | 2.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | else if (add) | 7 | else if (add) | ||||||||||||||
8 | Object previous = Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap().put(contentTypeIdentifier, new ResourceFactoryDescriptor(element, ATT_CLASS)); |
| 8 | Object previous = Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put(protocolName, new ResourceFactoryDescriptor(element, ATT_CLASS)); | |||||||||||||
9 | if (previous instanceof ResourceFactoryDescriptor) | 9 | if (previous instanceof ResourceFactoryDescriptor) | ||||||||||||||
10 | ResourceFactoryDescriptor descriptor = (ResourceFactoryDescriptor)previous; | 10 | ResourceFactoryDescriptor descriptor = (ResourceFactoryDescriptor)previous; | ||||||||||||||
11 | EcorePlugin.INSTANCE.log("Both '" + descriptor.element.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register a content parser for '" + contentTypeIdentifier + "'"); |
| 11 | EcorePlugin.INSTANCE.log("Both '" + descriptor.element.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register a protocol parser for '" + protocolName + "'"); | |||||||||||||
12 | return true; | 12 | return true; | ||||||||||||||
else | else | ||||||||||||||||
13 | Resource.Factory.Registry.INSTANCE.getContentTypeToFactoryMap().remove(contentTypeIdentifier); |
| 13 | Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().remove(protocolName); | |||||||||||||
14 | return true; | 14 | return true; |
Row | Violation |
---|