try { alterColumnComment(session, firstCol); failDialect(dialect, "column comment alter"); } catch (UnsupportedOperationException e) { // this is expected System.err.println(e.getMessage()); }
try { dropColumn(session, dropCol); failDialect(dialect, "dropping a column"); } catch (UnsupportedOperationException e) { // This is what we expect System.err.println(e.getMessage()); }
Clone fragments detected by clone detection tool
File path: /sql12/test/external/net/sourceforge/squirrel_sql/fw/dialects/DialectExternalTest.java File path: /sql12/test/external/net/sourceforge/squirrel_sql/fw/dialects/DialectExternalTest.java
Method name: void testAlterColumnComment(ISession) Method name: void testDropColumn(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try {
2
            alterColumnComment(session, firstCol);
2
            dropColumn(session, dropCol);
3
            failDialect(dialect, "column comment alter");
3
            failDialect(dialect, "dropping a column");
4
         } catch (UnsupportedOperationException e) {
4
         } catch (UnsupportedOperationException e) {
5
            // this is expected
5
            // This is what we expect
6
         	System.err.println(e.getMessage());
6
            System.err.println(e.getMessage());
7
         }
7
         }
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.4
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    try
    4
    try
    12
    alterColumnComment(session, firstCol);
    12
    alterColumnComment(session, firstCol);
    5
    dropColumn(session, dropCol);
    Differences
    Expression1Expression2Difference
    firstColdropColVARIABLE_NAME_MISMATCH
    alterColumnCommentdropColumnMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression alterColumnComment(session,firstCol) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method alterColumnComment
    Expression dropColumn(session,dropCol) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    • Inline private method dropColumn
    Expression alterColumnComment(session,firstCol) is a void method call, and thus it cannot be parameterized
    Expression dropColumn(session,dropCol) is a void method call, and thus it cannot be parameterized
    5
    dropColumn(session, dropCol);
    13
    failDialect(dialect, "column comment alter");
    13
    failDialect(dialect, "column comment alter");
    6
    failDialect(dialect, "dropping a column");
    Differences
    Expression1Expression2Difference
    "column comment alter""dropping a column"LITERAL_VALUE_MISMATCH
    6
    failDialect(dialect, "dropping a column");
    Precondition Violations (4)
    Row Violation
    1Expression alterColumnComment(session,firstCol) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression dropColumn(session,dropCol) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression alterColumnComment(session,firstCol) is a void method call, and thus it cannot be parameterized
    4Expression dropColumn(session,dropCol) is a void method call, and thus it cannot be parameterized