TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti);
String[] result = new String[infoArr.length];
for (int i = 0; i < result.length; i++)
{
TableColumnInfo colInfo = infoArr[i];
result[i] = colInfo.getColumnName();
}
return result;
TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti);
String[] result = new String[infoArr.length];
for (int i = 0; i < result.length; i++)
{
TableColumnInfo colInfo = infoArr[i];
result[i] = colInfo.getColumnName();
}
return result;
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dbcopy/src/net/sourceforge/squirrel_sql/plugins/dbcopy/util/DBUtil.java
|
|
File path: /sql12/plugins/dbdiff/src/net/sourceforge/squirrel_sql/plugins/dbdiff/util/DBUtil.java
|
Method name: String[] getColumnNames(ISQLConnection, ITableInfo)
|
|
Method name: String[] getColumnNames(ISQLConnection, ITableInfo)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti);↵ | | 1 | TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti);↵
|
2 | String[] result = new String[infoArr.length];↵ | | 2 | String[] result = new String[infoArr.length];↵
|
3 | for (int i = 0; i < result.length; i++)↵ | | 3 | for (int i = 0; i < result.length; i++)↵
|
4 | {↵ | | 4 | {↵
|
5 | TableColumnInfo colInfo = infoArr[i];↵ | | 5 | TableColumnInfo colInfo = infoArr[i];↵
|
6 | result[i] = colInfo.getColumnName();↵ | | 6 | result[i] = colInfo.getColumnName();↵
|
7 | }↵ | | 7 | }↵
|
8 | return result; | | 8 | return result;
|
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 |
Number of node comparisons | 18 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 2.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti); | | 1 | TableColumnInfo[] infoArr = sourceConn.getSQLMetaData().getColumnInfo(ti); |
2 | String[] result = new String[infoArr.length]; | | 2 | String[] result = new String[infoArr.length]; |
3 | for (int i = 0; i < result.length; i++) | | 3 | for (int i = 0; i < result.length; i++) |
4 | TableColumnInfo colInfo = infoArr[i]; | | 4 | TableColumnInfo colInfo = infoArr[i]; |
5 | result[i] = colInfo.getColumnName(); | | 5 | result[i] = colInfo.getColumnName(); |
6 | return result; | | 6 | return result; |
Precondition Violations (0)
Row |
Violation |