IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
if (dataTypeObject != null)
return dataTypeObject.areEqual(newValue, oldValue);
// we should never get here because the areEqual function is only
// called when we are trying to update the database, so we know
// that we have a DataType object for this column (or we would
// have been stopped from editing by the isEditableXXX methods),
// but we need a return here to keep the compiler happy.
return false;
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;
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 areEqual(ColumnDisplayDefinition, Object, Object)
|
|
Method name: boolean needToReRead(ColumnDisplayDefinition, Object)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);↵ | | 1 | IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);↵
|
2 | ↵ | | 2 | ↵
|
3 | if (dataTypeObject != null)↵ | | 3 | if (dataTypeObject != null)↵
|
4 | return dataTypeObject.areEqual(newValue, oldValue);↵ | | 4 | return dataTypeObject.↵
|
5 | ↵ | | |
|
6 | // we should never get here because the areEqual function is only↵ | | |
|
7 | // called when we are trying to update the database, so we know↵ | | |
|
8 | // that we have a DataType object for this column (or we would↵ | | |
|
9 | // have been stopped from editing by the isEditableXXX methods),↵ | | |
|
10 | // but we need a return here to keep the compiler happy.↵ | | 5 | needToReRead(originalValue);↵
|
| | | 6 | ↵
|
| | | 7 | // default - if we do not know the data type, then we cannot re-read it↵
|
11 | return false; | | 8 | return false;
|
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 | 4 |
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) | 0.7 |
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.areEqual(newValue, oldValue); | | 3 | return dataTypeObject.needToReRead(originalValue); |
4 | return false; | | 4 | return false; |
Precondition Violations (4)
Row |
Violation |
1 | Expression dataTypeObject.areEqual(newValue,oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression dataTypeObject.needToReRead(originalValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression dataTypeObject.areEqual(newValue,oldValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression dataTypeObject.needToReRead(originalValue) cannot be parameterized, because it has dependencies to/from statements that will be extracted |