try { dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs); failDialect(dialect, "renaming a table"); } catch (Exception e) { // This is expected System.err.println(e.getMessage()); }
try { dialect.getDropConstraintSQL(tableName, uniqueConstraintName, qualifier, prefs); failDialect(dialect, "for dropping a constraint"); } 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 testRenameTable(ISession) Method name: void testDropConstraint(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try
2
   
2
			{
3
			dialect.getRenameTableSQL(oldTableName, newTableName, 
3
				dialect.getDropConstraintSQL(tableName,
4
					uniqueConstraintName,
4
qualifier, 
5
					qualifier,
5
prefs);
6
					prefs);
6
   			failDialect(dialect, "renaming a table");
7
				failDialect(dialect, "for dropping a constraint");
7
   		} catch (Exception e) {
8
			} catch (Exception e)
8
   
9
			{
9
			// This is expected
10
				// this is expected
10
   			System.err.println(e.getMessage());
11
				System.err.println(e.getMessage());
11
   		}
12
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
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. {Non-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)2781.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    try
    10
    try
    12
    dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs);
    12
    dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs);
    11
    dialect.getDropConstraintSQL(tableName, uniqueConstraintName, qualifier, prefs);
    Differences
    Expression1Expression2Difference
    oldTableNametableNameVARIABLE_NAME_MISMATCH
    newTableNameuniqueConstraintNameVARIABLE_NAME_MISMATCH
    getRenameTableSQLgetDropConstraintSQLMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    Expression dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    11
    dialect.getDropConstraintSQL(tableName, uniqueConstraintName, qualifier, prefs);
    13
    failDialect(dialect, "renaming a table");
    13
    failDialect(dialect, "renaming a table");
    12
    failDialect(dialect, "for dropping a constraint");
    Differences
    Expression1Expression2Difference
    "renaming a table""for dropping a constraint"LITERAL_VALUE_MISMATCH
    12
    failDialect(dialect, "for dropping a constraint");
    Precondition Violations (4)
    Row Violation
    1Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    3Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    4Expression dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs) is a void method call, and thus it cannot be parameterized