final StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);
final HashMap<String, String> valuesMap = new HashMap<String, String>();
if (unique)
{
valuesMap.put(ST_UNIQUE_KEY, "UNIQUE");
if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod))
{
valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH");
}
}
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_TWO);
// "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");
if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod))
{
valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH");
}
}
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/MAXDBDialectExt.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/H2DialectExt.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: 9
|
|
Number of AST nodes: 9
|
|
1 | final StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);↵ | | 1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO);↵
|
2 | final ↵ | | 2 | // "CREATE $unique$ $storageOption$ INDEX $indexName$ " +↵
|
| | | 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 | if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod))↵ | | 8 | if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod))↵
|
8 | {↵ | | 9 | {↵
|
9 | valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH");↵ | | 10 | valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH");↵
|
10 | }↵ | | 11 | }↵
|
11 | }↵ | | 12 | }↵
|
12 | valuesMap.put(ST_INDEX_NAME_KEY, indexName);↵ | | 13 | valuesMap.put(ST_INDEX_NAME_KEY, indexName);↵
|
13 | valuesMap.put(ST_TABLE_NAME_KEY, tableName);↵ | | 14 | valuesMap.put(ST_TABLE_NAME_KEY, tableName);↵
|
|
14 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); | | 15 | 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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 33 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 4.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO); |
1 | final StringTemplate st = new StringTemplate(ST_CREATE_INDEX_STYLE_TWO); | | | |
| | | 2 | HashMap<String, String> valuesMap = new HashMap<String, String>(); |
2 | final 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 | if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod)) | | 5 | if (accessMethod != null && "HASH".equalsIgnoreCase(accessMethod)) |
6 | valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH"); | | 6 | valuesMap.put(ST_STORAGE_OPTION_KEY, "HASH"); |
7 | valuesMap.put(ST_INDEX_NAME_KEY, indexName); | | 7 | valuesMap.put(ST_INDEX_NAME_KEY, indexName); |
8 | valuesMap.put(ST_TABLE_NAME_KEY, tableName); | | 8 | valuesMap.put(ST_TABLE_NAME_KEY, tableName); |
9 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); | | 9 | return DialectUtils.getAddIndexSQL(this, st, valuesMap, columns, qualifier, prefs); |
Precondition Violations (0)
Row |
Violation |