File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/CommonHibernateDialect.java | File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/MySQLDialectExt.java | |||
Method name: String[] getUpdateSQL(String, String[], String[], String[], String[], String[], DatabaseObjectQualifier, SqlGenerationPreferences)
|
Method name: String[] getUpdateSQL(String, String[], String[], String[], String[], String[], DatabaseObjectQualifier, SqlGenerationPreferences)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | String templateStr = "";↵ | 1 | String templateStr = "";↵ | |
2 | if (fromTables != null)↵ | 2 | if (fromTables != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_ONE;↵ | 4 | templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;↵ | |
5 | } ↵ | 5 | }↵ | |
6 | else↵ | 6 | else↵ | |
7 | {↵ | 7 | {↵ | |
8 | templateStr = ST_UPDATE_STYLE_ONE;↵ | 8 | templateStr = ST_UPDATE_STYLE_ONE;↵ | |
9 | }↵ | 9 | }↵ | |
10 | StringTemplate st = new StringTemplate(templateStr);↵ | 10 | final StringTemplate st = new StringTemplate(templateStr);↵ | |
11 | return DialectUtils.getUpdateSQL(st,↵ | 11 | return DialectUtils.getUpdateSQL(st,↵ | |
12 | tableName,↵ | 12 | tableName,↵ | |
13 | setColumns,↵ | 13 | setColumns,↵ | |
14 | setValues,↵ | 14 | setValues,↵ | |
15 | fromTables,↵ | 15 | fromTables,↵ | |
16 | whereColumns,↵ | 16 | whereColumns,↵ | |
17 | whereValues,↵ | 17 | whereValues,↵ | |
18 | qualifier,↵ | 18 | qualifier,↵ | |
19 | prefs,↵ | 19 | prefs,↵ | |
20 | this); | 20 | this); | |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
Number of mapped statements | 5 |
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) | 4.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String templateStr = ""; | 1 | String templateStr = ""; | |||||||||||
2 | if (fromTables != null) | 2 | if (fromTables != null) | |||||||||||
3 | templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_ONE; |
| 3 | templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO; | ||||||||||
else | else | |||||||||||||
4 | templateStr = ST_UPDATE_STYLE_ONE; | 4 | templateStr = ST_UPDATE_STYLE_ONE; | |||||||||||
|
| 5 | final StringTemplate st = new StringTemplate(templateStr); | |||||||||||
5 | StringTemplate st = new StringTemplate(templateStr); |
| | |||||||||||
6 | return DialectUtils.getUpdateSQL(st, tableName, setColumns, setValues, fromTables, whereColumns, whereValues, qualifier, prefs, this); | 6 | return DialectUtils.getUpdateSQL(st, tableName, setColumns, setValues, fromTables, whereColumns, whereValues, qualifier, prefs, this); |
Row | Violation |
---|---|
1 | Unmatched statement final StringTemplate st=new StringTemplate(templateStr); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement StringTemplate st=new StringTemplate(templateStr); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |