final IExtension ext = extensionEnumeration.nextElement();
IComponentPlugin p;
try {
p = (IComponentPlugin) ext.instanciateExtension(null);
p.init();
} catch (final PluginException e) {
LOG.severe(e.getMessage());
if (Logging.DEBUG) {
e.printStackTrace();
}
}
final IExtension ext = extensionEnumeration.nextElement();
IComponentPlugin p;
try {
p = (IComponentPlugin) ext.instanciateExtension(null);
p.registerCommandLineArguments();
} catch (final PluginException e) {
LOG.severe(e.getMessage());
if (Logging.DEBUG) {
e.printStackTrace();
}
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/component/ComponentManager.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/component/ComponentManager.java
|
Method name: void init()
|
|
Method name: void registerCommandLineArguments()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | final IExtension ext = extensionEnumeration.nextElement();↵ | | 1 | final IExtension ext = extensionEnumeration.nextElement();↵
|
2 | IComponentPlugin p;↵ | | 2 | IComponentPlugin p;↵
|
|
3 | try {↵ | | 3 | try {↵
|
4 | p = (IComponentPlugin) ext.instanciateExtension(null);↵ | | 4 | p = (IComponentPlugin) ext.instanciateExtension(null);↵
|
5 | p.init();↵ | | 5 | p.registerCommandLineArguments();↵
|
6 | } catch (final PluginException e) {↵ | | 6 | } catch (final PluginException e) {↵
|
7 | LOG.severe(e.getMessage());↵ | | 7 | LOG.severe(e.getMessage());↵
|
|
8 | if (Logging.DEBUG) {↵ | | 8 | if (Logging.DEBUG) {↵
|
9 | e.printStackTrace();↵ | | 9 | e.printStackTrace();↵
|
10 | }↵ | | 10 | }↵
|
11 | ↵ | | 11 | ↵
|
12 | } | | 12 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
-
{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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | final IExtension ext = extensionEnumeration.nextElement(); | | 3 | final IExtension ext = extensionEnumeration.nextElement(); |
4 | IComponentPlugin p; | | 4 | IComponentPlugin p; |
5 | try | | 5 | try |
6 | p = (IComponentPlugin)ext.instanciateExtension(null); | | 6 | p = (IComponentPlugin)ext.instanciateExtension(null); |
7 | | | 7 | p.registerCommandLineArguments(); |
Precondition Violations (4)
Row |
Violation |
1 | Expression p.init() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression p.registerCommandLineArguments() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression p.init() is a void method call, and thus it cannot be parameterized |
4 | Expression p.registerCommandLineArguments() is a void method call, and thus it cannot be parameterized |