try { dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol, qualifier, prefs); failDialect(dialect, "column default alter"); } catch (UnsupportedOperationException e) { // This is what we expect. System.err.println(e.getMessage()); }
try { dialect.getViewDefinitionSQL(viewName, qualifier, prefs); failDialect(dialect, "getting the view definition"); } 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 testAlterDefaultValue(ISession) Method name: void testGetViewDefinition(ISession)
Number of AST nodes: 3 Number of AST nodes: 3
1
try {
1
try {
2
            dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol, qualifier, prefs);
2
   			dialect.getViewDefinitionSQL(viewName, qualifier, prefs);
3
            failDialect(dialect, "column default alter");
3
   			failDialect(dialect, "getting the view definition");
4
         } catch (UnsupportedOperationException e) {
4
   		} catch (Exception e) {
5
            // This is what we expect.
5
   			// this is expected
6
            System.err.println(e.getMessage());
6
   			System.err.println(e.getMessage());
7
         }
7
   		}
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
    13
    try
    13
    try
    21
    try
    Differences
    Expression1Expression2Difference
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.UnsupportedOperationExceptionjava.lang.ExceptionSUBCLASS_TYPE_MISMATCH
    21
    try
    14
    dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol, qualifier, prefs);
    14
    dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol, qualifier, prefs);
    Preondition Violations
    Unmatched statement dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol,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
                                                                                                                                                                  
                                                                                                                          
    22
    dialect.getViewDefinitionSQL(viewName, qualifier, prefs);
    Preondition Violations
    Unmatched statement dialect.getViewDefinitionSQL(viewName,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
    22
    dialect.getViewDefinitionSQL(viewName, qualifier, prefs);
    15
    failDialect(dialect, "column default alter");
    15
    failDialect(dialect, "column default alter");
    23
    failDialect(dialect, "getting the view definition");
    Differences
    Expression1Expression2Difference
    "column default alter""getting the view definition"LITERAL_VALUE_MISMATCH
    23
    failDialect(dialect, "getting the view definition");
    Precondition Violations (2)
    Row Violation
    1Unmatched statement dialect.getColumnDefaultAlterSQL(noDefaultValueVarcharCol,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.getViewDefinitionSQL(viewName,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