for (DefaultXmlConfig plugin : getPluginList()) {
if (plugin == null) {
continue;
}
plugin.save();
}
for (DefaultXmlConfig plugin : getPluginList()) {
if (plugin == null) {
continue;
}
plugin.load();
}
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/config/Config.java
|
|
File path: /columba-1.4-src/core/src/main/java/org/columba/core/config/Config.java
|
Method name: void save()
|
|
Method name: void load()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (DefaultXmlConfig plugin : getPluginList()) {↵ | | 1 | for (DefaultXmlConfig plugin : getPluginList()) {↵
|
2 | if (plugin == null) {↵ | | 2 | if (plugin == null) {↵
|
3 | continue;↵ | | 3 | continue;↵
|
4 | }↵ | | 4 | }↵
|
|
5 | plugin.save();↵ | | 5 | plugin.load();↵
|
6 | } | | 6 | }
|
See real code fragment |
|
See real code fragment |
Summary
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 declared in the same class |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | for (DefaultXmlConfig plugin : getPluginList()) | | 1 | for (DefaultXmlConfig plugin : getPluginList()) |
2 | | | 2 | |
3 | | | 3 | |
| | | 4 | |
4 | | | | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement plugin.load(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement plugin.save(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement plugin.save(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |