try { dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs); failDialect(dialect, "dropping a primary key"); } catch (UnsupportedOperationException e) { // this is expected System.err.println(e.getMessage()); }
try { dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs); failDialect(dialect, "renaming a table"); } 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 testDropPrimaryKey(ISession, String) Method name: void testRenameTable(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try
1
try
2
			{
3
	
2
 {
4
			dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs);
3
   			dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs);
5
				failDialect(dialect, "dropping a primary key");
4
   			failDialect(dialect, "renaming a table");
6
         } catch (UnsupportedOperationException e) {
5
   		} catch (Exception e) {
7
            // this is expected
6
   			// This is expected
8
         	System.err.println(e.getMessage());
7
   			System.err.println(e.getMessage());
9
         }
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.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)11.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    try
    10
    try
    11
    try
    Differences
    Expression1Expression2Difference
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    11
    try
    11
    dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs);
    11
    dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs);
    12
    dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs);
    Differences
    Expression1Expression2Difference
    pkNameoldTableNameVARIABLE_NAME_MISMATCH
    tableNamenewTableNameVARIABLE_NAME_MISMATCH
    getDropPrimaryKeySQLgetRenameTableSQLMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression dialect.getDropPrimaryKeySQL(pkName,tableName,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 method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression dialect.getDropPrimaryKeySQL(pkName,tableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    12
    dialect.getRenameTableSQL(oldTableName, newTableName, qualifier, prefs);
    12
    failDialect(dialect, "dropping a primary key");
    12
    failDialect(dialect, "dropping a primary key");
    13
    failDialect(dialect, "renaming a table");
    Differences
    Expression1Expression2Difference
    "dropping a primary key""renaming a table"LITERAL_VALUE_MISMATCH
    13
    failDialect(dialect, "renaming a table");
    Precondition Violations (4)
    Row Violation
    1Expression dialect.getDropPrimaryKeySQL(pkName,tableName,qualifier,prefs) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    2Expression 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
    3Expression dialect.getDropPrimaryKeySQL(pkName,tableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized
    4Expression dialect.getRenameTableSQL(oldTableName,newTableName,qualifier,prefs) is a void method call, and thus it cannot be parameterized