try { dialect.getAddAutoIncrementSQL(autoIncrementColumn, qualifier, prefs); failDialect(dialect, "for adding an auto increment column"); } catch (Exception e) { // this is expected System.err.println(e.getMessage()); }
try { dialect.getAddColumnSQL(addColumn, qualifier, prefs); failDialect(dialect, "for adding a column"); } catch (Exception e) { // this is expected 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 testAddAutoIncrement(ISession) Method name: void testAddColumnSQL(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try
2
   
2
			{
3
			dialect.getAddAutoIncrementSQL(autoIncrementColumn, qualifier, prefs);
3
				dialect.getAddColumnSQL(addColumn, qualifier, prefs);
4
   			failDialect(dialect, "for adding an auto increment column");
4
				failDialect(dialect, "for adding a column");
5
   		} catch (Exception e) {
5
			} catch (Exception e)
6
   
6
			{
7
			// this is expected
7
				// this is expected
8
   			System.err.println(e.getMessage());
8
				System.err.println(e.getMessage());
9
   		}
9
			}
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)938.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    try
    5
    try
    9
    dialect.getAddAutoIncrementSQL(autoIncrementColumn, qualifier, prefs);
    9
    dialect.getAddAutoIncrementSQL(autoIncrementColumn, qualifier, prefs);
    6
    dialect.getAddColumnSQL(addColumn, qualifier, prefs);
    Differences
    Expression1Expression2Difference
    autoIncrementColumnaddColumnVARIABLE_NAME_MISMATCH
    getAddAutoIncrementSQLgetAddColumnSQLMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression dialect.getAddAutoIncrementSQL(autoIncrementColumn,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression dialect.getAddColumnSQL(addColumn,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression dialect.getAddAutoIncrementSQL(autoIncrementColumn,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    Expression dialect.getAddColumnSQL(addColumn,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    6
    dialect.getAddColumnSQL(addColumn, qualifier, prefs);
    10
    failDialect(dialect, "for adding an auto increment column");
    10
    failDialect(dialect, "for adding an auto increment column");
    7
    failDialect(dialect, "for adding a column");
    Differences
    Expression1Expression2Difference
    "for adding an auto increment column""for adding a column"LITERAL_VALUE_MISMATCH
    7
    failDialect(dialect, "for adding a column");
    Precondition Violations (4)
    Row Violation
    1Expression dialect.getAddAutoIncrementSQL(autoIncrementColumn,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression dialect.getAddColumnSQL(addColumn,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression dialect.getAddAutoIncrementSQL(autoIncrementColumn,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    4Expression dialect.getAddColumnSQL(addColumn,qualifier,prefs) is a void method call, and thus it cannot be parameterized