StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
HashMap<String, String> valuesMap = new HashMap<String, String>();
if (unique)
{
valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");
}
// TODO: Need to add storageOptions to the add index dialog
// valuesMap.put(ST_STORAGE_OPTION_KEY, );
valuesMap.put(ST_INDEX_NAME_KEY, indexName);
valuesMap.put(ST_TABLE_NAME_KEY, tableName);
return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs);
StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_THREE);
// "CREATE $unique$ $storageOption$ INDEX $indexName$ " +
// "ON $tableName$ ( $columnName; separator=\",\"$ )";
HashMap<String, String> valuesMap = new HashMap<String, String>();
if (unique)
{
valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");
}
valuesMap.put(ST_INDEX_NAME_KEY, indexName);
valuesMap.put(ST_TABLE_NAME_KEY, tableName);
return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs);
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/SybaseDialectExt.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/FirebirdDialectExt.java
|
Method name: String getCreateIndexSQL(String, String, String, String[], boolean, String, String, DatabaseObjectQualifier, SqlGenerationPreferences)
|
|
Method name: String getCreateIndexSQL(String, String, String, String[], boolean, String, String, DatabaseObjectQualifier, SqlGenerationPreferences)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO)↵ | | 1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_THREE);↵
|
| | | 2 | // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +↵
|
2 | ;↵ | | 3 | // "ON $tableName$ ( $columnName; separator=\",\"$ )";↵
|
|
3 | HashMap<String, String> valuesMap = new HashMap<String, String>();↵ | | 4 | HashMap<String, String> valuesMap = new HashMap<String, String>();↵
|
|
4 | if (unique)↵ | | 5 | if (unique)↵
|
5 | {↵ | | 6 | {↵
|
6 | valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");↵ | | 7 | valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");↵
|
7 | }↵ | | 8 | }↵
|
|
8 | // TODO: Need to add storageOptions to the add index dialog↵ | | |
|
9 | // valuesMap.put(ST_STORAGE_OPTION_KEY, );↵ | | |
|
|
10 | valuesMap.put(ST_INDEX_NAME_KEY, indexName);↵ | | 9 | valuesMap.put(ST_INDEX_NAME_KEY, indexName);↵
|
11 | valuesMap.put(ST_TABLE_NAME_KEY, tableName);↵ | | 10 | valuesMap.put(ST_TABLE_NAME_KEY, tableName);↵
|
|
12 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); | | 11 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs);
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 3.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO); | | 1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_THREE); |
2 | HashMap<String, String> valuesMap = new HashMap<String, String>(); | | 2 | HashMap<String, String> valuesMap = new HashMap<String, String>(); |
3 | if (unique) | | 3 | if (unique) |
4 | valuesMap.put(ST_UNIQUE_KEY, "UNIQUE"); | | 4 | valuesMap.put(ST_UNIQUE_KEY, "UNIQUE"); |
5 | valuesMap.put(ST_INDEX_NAME_KEY, indexName); | | 5 | valuesMap.put(ST_INDEX_NAME_KEY, indexName); |
6 | valuesMap.put(ST_TABLE_NAME_KEY, tableName); | | 6 | valuesMap.put(ST_TABLE_NAME_KEY, tableName); |
7 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); | | 7 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); |
Precondition Violations (0)
Row |
Violation |