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);
String templateStr = ""; if (fromTables != null) { templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO; } else { templateStr = ST_UPDATE_STYLE_ONE; } 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/MySQLDialectExt.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/SybaseDialectExt.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
		
2
		if (fromTables != null)
3
		if (fromTables != null)
3
		{
4
 {
4
			templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;
5
			templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;
5
		}
6
		}
6
		else
7
 else
7
		{
8
 {
8
			templateStr = ST_UPDATE_STYLE_ONE;
9
			templateStr = ST_UPDATE_STYLE_ONE;
9
		}
10
		}
11
			
10
		final StringTemplate st = new StringTemplate(templateStr);
12
		StringTemplate st = new StringTemplate(templateStr);
13
		
11
		return DialectUtils.getUpdateSQL(st, 
14
		return DialectUtils.getUpdateSQL(st,
12
tableName, 
15
			tableName,
13
setColumns, 
16
			setColumns,
14
setValues, 
17
			setValues,
15
fromTables, 
18
			fromTables,
16
whereColumns,
19
			whereColumns,
17
			whereValues, 
20
			whereValues,
18
qualifier, 
21
			qualifier,
19
prefs, 
22
			prefs,
20
this);
23
			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.1
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.2
    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_TWO;
    3
    templateStr = ST_UPDATE_CORRELATED_QUERY_STYLE_TWO;
    else
    else
    4
    templateStr = ST_UPDATE_STYLE_ONE;
    4
    templateStr = ST_UPDATE_STYLE_ONE;
                                                                                                              
    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
    5
    StringTemplate st = new StringTemplate(templateStr);
    5
    final StringTemplate st = new StringTemplate(templateStr);
    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
                                                                                                                          
    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 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 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