boolean result = false;
switch (jdbcType)
{
case Types.BIGINT:
case Types.DECIMAL:
case Types.DOUBLE:
case Types.FLOAT:
case Types.INTEGER:
case Types.NUMERIC:
result = true;
break;
default:
result = false;
}
return result;
boolean result = false;
switch (jdbcType)
{
case Types.DATE:
case Types.TIME:
case Types.TIMESTAMP:
result = true;
break;
default:
result = false;
}
return result;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/JDBCTypeMapper.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/JDBCTypeMapper.java
|
Method name: boolean isNumberType(int)
|
|
Method name: boolean isDateType(int)
|
Number of AST nodes: 13
|
|
Number of AST nodes: 10
|
|
1 | boolean result = false;↵ | | 1 | boolean result = false;↵
|
2 | switch (jdbcType)↵ | | 2 | switch (jdbcType)↵
|
3 | {↵ | | 3 | {↵
|
4 | case Types.BIGINT:↵ | | 4 | case Types.↵
|
5 | case Types.DECIMAL:↵ | | |
|
6 | case Types.DOUBLE:↵ | | 5 | DATE:↵
|
7 | case Types.FLOAT:↵ | | 6 | case Types.TIME:↵
|
8 | case Types.INTEGER:↵ | | 7 | case Types.↵
|
9 | case Types.NUMERIC:↵ | | 8 | TIMESTAMP:↵
|
10 | result = true;↵ | | 9 | result = true;↵
|
11 | break;↵ | | 10 | break;↵
|
12 | default:↵ | | 11 | default:↵
|
13 | result = false;↵ | | 12 | result = false;↵
|
14 | }↵ | | 13 | }↵
|
15 | return result; | | 14 | 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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 11 |
Number of unmapped statements in the second code fragment | 8 |
Time elapsed for statement mapping (ms) | 1.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | boolean result = false; | | 1 | boolean result = false; |
| | | 2 | switch (jdbcType) |
| | | 3 | |
| | | 4 | |
| | | 5 | |
| | | 6 | |
| | | 7 | |
| | | 8 | |
| | | 9 | |
2 | switch (jdbcType) | | | |
3 | | | | |
4 | | | | |
5 | | | | |
6 | | | | |
7 | | | | |
8 | | | | |
9 | | | | |
10 | | | | |
11 | | | | |
12 | | | | |
13 | return result; | | 10 | return result; |
Precondition Violations (6)
Row |
Violation |
1 | Unmatched statement result=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched break; |
3 | Unmatched statement result=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement result=true; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched break; |
6 | Unmatched statement result=false; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |