StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE);
HashMap<String, String> valuesMap =
DialectUtils.getValuesMap(ST_TABLE_NAME_KEY,
info.getTableName(),
ST_COLUMN_NAME_KEY,
info.getColumnName());
if (info.isNullable().equalsIgnoreCase("YES"))
{
valuesMap.put(ST_NULLABLE_KEY, "NULL");
} else
{
valuesMap.put(ST_NULLABLE_KEY, "NOT NULL");
}
return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs) };
final StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE);
final HashMap<String, String> valuesMap =
DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, info.getTableName(), ST_COLUMN_NAME_KEY,
info.getColumnName());
if (info.isNullable().equalsIgnoreCase("YES"))
{
valuesMap.put(ST_NULLABLE_KEY, "NULL");
}
else
{
valuesMap.put(ST_NULLABLE_KEY, "NOT NULL");
}
return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs) };
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/HSQLDialectExt.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/dialects/ProgressDialectExt.java
|
Method name: String[] getColumnNullableAlterSQL(TableColumnInfo, DatabaseObjectQualifier, SqlGenerationPreferences)
|
|
Method name: String[] getColumnNullableAlterSQL(TableColumnInfo, DatabaseObjectQualifier, SqlGenerationPreferences)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE);↵ | | 1 | final StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE);↵
|
2 | HashMap<String, String> valuesMap =↵ | | 2 | final HashMap<String, String> valuesMap =↵
|
3 | DialectUtils.getValuesMap(ST_TABLE_NAME_KEY,↵ | | 3 | DialectUtils.getValuesMap(ST_TABLE_NAME_KEY,↵
|
4 | info.getTableName(),↵ | | 4 | info.getTableName(),↵
|
5 | ST_COLUMN_NAME_KEY,↵ | | 5 | ST_COLUMN_NAME_KEY,↵
|
6 | info.getColumnName());↵ | | 6 | info.getColumnName());↵
|
|
7 | if (info.isNullable().equalsIgnoreCase("YES"))↵ | | 7 | if (info.isNullable().equalsIgnoreCase("YES"))↵
|
8 | {↵ | | 8 | {↵
|
9 | valuesMap.put(ST_NULLABLE_KEY, "NULL");↵ | | 9 | valuesMap.put(ST_NULLABLE_KEY, "NULL");↵
|
10 | } ↵ | | 10 | }↵
|
11 | else↵ | | 11 | else↵
|
12 | {↵ | | 12 | {↵
|
13 | valuesMap.put(ST_NULLABLE_KEY, "NOT NULL");↵ | | 13 | valuesMap.put(ST_NULLABLE_KEY, "NOT NULL");↵
|
14 | }↵ | | 14 | }↵
|
15 | return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs) }; | | 15 | return new String[] { DialectUtils.bindTemplateAttributes(this, st, valuesMap, 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 | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 2.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | final StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE); |
1 | StringTemplate st = new StringTemplate(ST_ALTER_COLUMN_NULL_STYLE_ONE); | | | |
| | | 2 | final HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, info.getTableName(), ST_COLUMN_NAME_KEY, info.getColumnName()); |
2 | HashMap<String, String> valuesMap = DialectUtils.getValuesMap(ST_TABLE_NAME_KEY, info.getTableName(), ST_COLUMN_NAME_KEY, info.getColumnName()); | | | |
3 | if (info.isNullable().equalsIgnoreCase("YES")) | | 3 | if (info.isNullable().equalsIgnoreCase("YES")) |
4 | valuesMap.put(ST_NULLABLE_KEY, "NULL"); | | 4 | valuesMap.put(ST_NULLABLE_KEY, "NULL"); |
| | | | |
5 | valuesMap.put(ST_NULLABLE_KEY, "NOT NULL"); | | 5 | valuesMap.put(ST_NULLABLE_KEY, "NOT NULL"); |
6 | return new String[] {DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs)}; | | 6 | return new String[] {DialectUtils.bindTemplateAttributes(this, st, valuesMap, qualifier, prefs)}; |
Precondition Violations (0)
Row |
Violation |