for (int i = 16; i <= 20; i++) {
dialog.writeLine("A line of text. (" + i + ")");
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
for (int i = 1; i <= 15; i++) {
dialog.writeLine("A line of text. (" + i + ")");
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/gui/MessageDialog.java
|
|
File path: /sql12/plugins/postgres/src/net/sourceforge/squirrel_sql/plugins/postgres/gui/MessageDialog.java
|
Method name: void main(String[])
|
|
Method name: void main(String[])
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | for (int i = 16; i <= 20; i++) {↵ | | 1 | for (int i = 1; i <= 15; i++) {↵
|
2 | dialog.writeLine("A line of text. (" + i + ")");↵ | | 2 | dialog.writeLine("A line of text. (" + i + ")");↵
|
3 | try {↵ | | 3 | try {↵
|
4 | Thread.sleep(100);↵ | | 4 | Thread.sleep(100);↵
|
5 | } catch (InterruptedException e) {↵ | | 5 | } catch (InterruptedException e) {↵
|
6 | e.printStackTrace();↵ | | 6 | e.printStackTrace();↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 8 | }
|
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 in the same method |
Number of node comparisons | 8 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
13 | for (int i = 16; i <= 20; i++) | | 5 | for (int i = 1; i <= 15; i++) |
14 | dialog.writeLine("A line of text. (" + i + ")"); | | 6 | dialog.writeLine("A line of text. (" + i + ")"); |
15 | | | 7 | |
16 | | | 8 | |
Precondition Violations (0)
Row |
Violation |