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.getRenameViewSQL(oldViewName, newViewName, qual, prefs); failDialect(dialect, "renaming a view"); } 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 testRenameView(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.getRenameViewSQL(oldViewName, newViewName, qual, prefs);
5
				failDialect(dialect, "dropping a primary key");
4
   			failDialect(dialect, "renaming a view");
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 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 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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    try
    10
    try
    28
    try
    Differences
    Expression1Expression2Difference
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    28
    try
    11
    dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs);
    11
    dialect.getDropPrimaryKeySQL(pkName, tableName, qualifier, prefs);
    Preondition Violations
    Unmatched statement dialect.getDropPrimaryKeySQL(pkName,tableName,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
                                                                                                                                          
                                                                                                                                      
    29
    dialect.getRenameViewSQL(oldViewName, newViewName, qual, prefs);
    Preondition Violations
    Unmatched statement dialect.getRenameViewSQL(oldViewName,newViewName,qual,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
    29
    dialect.getRenameViewSQL(oldViewName, newViewName, qual, prefs);
    12
    failDialect(dialect, "dropping a primary key");
    12
    failDialect(dialect, "dropping a primary key");
    30
    failDialect(dialect, "renaming a view");
    Differences
    Expression1Expression2Difference
    "dropping a primary key""renaming a view"LITERAL_VALUE_MISMATCH
    30
    failDialect(dialect, "renaming a view");
    Precondition Violations (2)
    Row Violation
    1Unmatched statement dialect.getDropPrimaryKeySQL(pkName,tableName,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.getRenameViewSQL(oldViewName,newViewName,qual,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