IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
if (dataTypeObject != null)
return dataTypeObject.needToReRead(originalValue);
// default - if we do not know the data type, then we cannot re-read it
return false;
IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
if (dataTypeObject != null)
return dataTypeObject.getDefaultValue(dbDefaultValue);
// there was no data type object, so this data type is unknown
// to squirrel and thus cannot be edited.
return null;
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/CellComponentFactory.java
|
|
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/CellComponentFactory.java
|
Method name: boolean needToReRead(ColumnDisplayDefinition, Object)
|
|
Method name: Object getDefaultValue(ColumnDisplayDefinition, String)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);↵ | | 1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);↵
|
2 | ↵ | | |
|
3 | ↵ | | |
|
4 | if (dataTypeObject != null)↵ | | 2 | if (dataTypeObject != null)↵
|
5 | return dataTypeObject.needToReRead(originalValue);↵ | | 3 | return dataTypeObject.↵
|
6 | ↵ | | |
|
7 | // default - if we do not know↵ | | 4 | getDefaultValue(dbDefaultValue);↵
|
|
8 | the data type, then we cannot re-read it↵ | | 5 | // there was no data type object, so this data type↵
|
9 | ↵ | | 6 | is unknown↵
|
| | | 7 | // to squirrel and thus cannot be edited.↵
|
10 | return false; | | 8 | return null;
|
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.1 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
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) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef); | | 1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef); |
2 | if (dataTypeObject != null) | | 2 | if (dataTypeObject != null) |
| | | 3 | return dataTypeObject.getDefaultValue(dbDefaultValue); |
3 | return dataTypeObject.needToReRead(originalValue); | | | |
| | | 4 | return null; |
4 | return false; | | | |
Precondition Violations (6)
Row |
Violation |
1 | Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return dataTypeObject.getDefaultValue(dbDefaultValue); |
3 | Unmatched statement return dataTypeObject.needToReRead(originalValue); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return dataTypeObject.needToReRead(originalValue); |
5 | Unmatched return null; |
6 | Unmatched return false; |