try { dialect.getColumnTypeAlterSQL(thirdCol, thirdColLonger, qualifier, prefs); failDialect(dialect, "altering column type"); } catch (UnsupportedOperationException 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 testAlterColumnlength(ISession) Method name: void testDropConstraint(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try
2
            dialect.getColumnTypeAlterSQL(thirdCol, thirdColLonger, 
2
			{
3
				dialect.getDropConstraintSQL(tableName,
4
					uniqueConstraintName,
3
qualifier, 
5
					qualifier,
4
prefs);
6
					prefs);
5
            failDialect(dialect, "altering column type");
7
				failDialect(dialect, "
6
         } catch (UnsupportedOperationException e) {
7
            
8
for dropping a constraint");
9
			} catch (Exception e)
10
			{
8
// this is expected
11
				// this is expected
9
         	System.err.println(e.getMessage());
12
				System.err.println(e.getMessage());
10
         }
13
			}
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.5
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    try
    10
    try
    10
    try
    Differences
    Expression1Expression2Difference
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    10
    try
                                                                                                                                                                      
    11
    dialect.getDropConstraintSQL(tableName, uniqueConstraintName, qualifier, prefs);
    Preondition Violations
    Unmatched statement dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    11
    dialect.getDropConstraintSQL(tableName, uniqueConstraintName, qualifier, prefs);
    11
    dialect.getColumnTypeAlterSQL(thirdCol, thirdColLonger, qualifier, prefs);
    11
    dialect.getColumnTypeAlterSQL(thirdCol, thirdColLonger, qualifier, prefs);
    Preondition Violations
    Unmatched statement dialect.getColumnTypeAlterSQL(thirdCol,thirdColLonger,qualifier,prefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                                          
    12
    failDialect(dialect, "altering column type");
    12
    failDialect(dialect, "altering column type");
    12
    failDialect(dialect, "for dropping a constraint");
    Differences
    Expression1Expression2Difference
    "altering column type""for dropping a constraint"LITERAL_VALUE_MISMATCH
    12
    failDialect(dialect, "for dropping a constraint");
    Precondition Violations (2)
    Row Violation
    1Unmatched statement dialect.getDropConstraintSQL(tableName,uniqueConstraintName,qualifier,prefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2Unmatched statement dialect.getColumnTypeAlterSQL(thirdCol,thirdColLonger,qualifier,prefs); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted