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 testAddPrimaryKey(ISession, TableColumnInfo[])
|
Method name: void testCreateTableSql(ISession)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | try {↵ | 1 | try {↵ | |
2 | dialect.getAddPrimaryKeySQL(pkName, colInfos, ti, qualifier, prefs);↵ | 2 | dialect.getCreateTableSQL(tableName, columns, pkColumns, prefs, qualifier);↵ | |
3 | failDialect(dialect, "adding a primary key");↵ | 3 | failDialect(dialect, "creating a table");↵ | |
4 | } catch (Exception e) {↵ | 4 | } catch (Exception e) {↵ | |
5 | // This is expected↵ | 5 | // This is expected↵ | |
6 | System.err.println(e.getMessage());↵ | 6 | System.err.println(e.getMessage());↵ | |
7 | } | 7 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
25 | try | 17 | try | |||||||||||
|
| 18 | dialect.getCreateTableSQL(tableName, columns, pkColumns, prefs, qualifier); | |||||||||||
26 | dialect.getAddPrimaryKeySQL(pkName, colInfos, ti, qualifier, prefs); |
| | |||||||||||
27 | failDialect(dialect, "adding a primary key"); |
| 19 | failDialect(dialect, "creating a table"); |
Row | Violation |
---|---|
1 | Unmatched statement dialect.getCreateTableSQL(tableName,columns,pkColumns,prefs,qualifier); 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 |
2 | Unmatched statement dialect.getAddPrimaryKeySQL(pkName,colInfos,ti,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 |