if (dbDefaultValue != null) {
// try to use the DB default value
StringBuffer mbuf = new StringBuffer();
Object newObject = validateAndConvert(dbDefaultValue, null, mbuf);
// if there was a problem with converting, then just fall through
// and continue as if there was no default given in the DB.
// Otherwise, use the converted object
if (mbuf.length() == 0)
return newObject;
}
if (dbDefaultValue != null) {
// try to use the DB default value
StringBuffer mbuf = new StringBuffer();
Object newObject = validateAndConvert(dbDefaultValue, null, mbuf);
// if there was a problem with converting, then just fall through
// and continue as if there was no default given in the DB.
// Otherwise, use the converted object
if (mbuf.length() == 0)
return newObject;
}
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeByte.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeInteger.java
|
Method name: Object getDefaultValue(String)
|
|
Method name: Object getDefaultValue(String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (dbDefaultValue != null) {↵ | | 1 | if (dbDefaultValue != null) {↵
|
2 | // try to use the DB default value↵ | | 2 | // try to use the DB default value↵
|
3 | StringBuffer mbuf = new StringBuffer();↵ | | 3 | StringBuffer mbuf = new StringBuffer();↵
|
4 | Object newObject = validateAndConvert(dbDefaultValue, null, mbuf);↵ | | 4 | Object newObject = validateAndConvert(dbDefaultValue, null, mbuf);↵
|
5 | ↵ | | 5 | ↵
|
6 | // if there was a problem with converting, then just fall through↵ | | 6 | // if there was a problem with converting, then just fall through↵
|
7 | // and continue as if there was no default given in the DB.↵ | | 7 | // and continue as if there was no default given in the DB.↵
|
8 | // Otherwise, use the converted object↵ | | 8 | // Otherwise, use the converted object↵
|
9 | if (mbuf.length() == 0)↵ | | 9 | if (mbuf.length() == 0)↵
|
10 | return newObject;↵ | | 10 | return newObject;↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 1.1 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (dbDefaultValue != null) | | 1 | if (dbDefaultValue != null) |
2 | StringBuffer mbuf = new StringBuffer(); | | 2 | StringBuffer mbuf = new StringBuffer(); |
3 | Object newObject = validateAndConvert(dbDefaultValue, null, mbuf); | | 3 | Object newObject = validateAndConvert(dbDefaultValue, null, mbuf); |
4 | | | 4 | |
5 | | | 5 | |
Precondition Violations (1)
Row |
Violation |
1 | Not all possible execution flows end in a return statement |