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
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons8
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    for (int i = 16; i <= 20; i++)
    13
    for (int i = 16; i <= 20; i++)
    5
    for (int i = 1; i <= 15; i++)
    Differences
    Expression1Expression2Difference
    161LITERAL_VALUE_MISMATCH
    2015LITERAL_VALUE_MISMATCH
    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
    try
    7
    try
    16
    Thread.sleep(100);
    8
    Thread.sleep(100);
    Precondition Violations (0)
    Row Violation