String templateStr = ""; if (fromTables != null) { templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_ONE; } else { templateStr = ST_UPDATE_STYLE_ONE; } StringTemplate st = new StringTemplate(templateStr); return DialectUtils.getUpdateSQL(st, tableName, setColumns, setValues, fromTables, whereColumns, whereValues, qualifier, prefs, this);
String templateStr = ""; if (fromTables != null) { templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO; } else { templateStr = ST_UPDATE_STYLE_ONE; } final StringTemplate st = new StringTemplate(templateStr); return DialectUtils.getUpdateSQL(st, tableName, setColumns, setValues, fromTables, whereColumns, whereValues, qualifier, prefs, this);
Clone fragments detected by clone detection tool
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);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.6
    Clone typeType 2
    Mapped Statements
    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_ONE;
    3
    templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;
    Differences
    Expression1Expression2Difference
    ST_UPDATE_CORRELATED_QUERY_STYLE_ONEST_UPDATE_CORRELATED_QUERY_STYLE_TWOVARIABLE_NAME_MISMATCH
    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);
    Preondition Violations
    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
    5
    final StringTemplate st = new StringTemplate(templateStr);
    5
    StringTemplate st = new StringTemplate(templateStr);
    5
    StringTemplate st = new StringTemplate(templateStr);
    Preondition Violations
    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
                                                                                                              
    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);
    Precondition Violations (2)
    Row Violation
    1Unmatched 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
    2Unmatched 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