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: 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 | if (dataTypeObject != null)↵ | 2 | if (dataTypeObject != null)↵ | |
4 | return dataTypeObject.areEqual(newValue, oldValue);↵ | 3 | return dataTypeObject.↵ | |
5 | ↵ | |||
6 | // we should never get here because the areEqual function is only↵ | |||
7 | // called when we are trying to up↵ | 4 | getDefaultValue(dbDefaultValue);↵ | |
8 | date the database, so we know↵ | 5 | // there was no data t↵ | |
9 | // that we have a DataType object for this column (or we would↵ | |||
10 | // have been stopped from editing by the isEditableXXX methods),↵ | |||
11 | // bu↵ | 6 | ype object, so this data type is unknown↵ | |
12 | t we need a return here to keep the compiler happy.↵ | 7 | // to squirrel and thus cannot be ↵ | |
13 | ↵ | 8 | edited.↵ | |
14 | return false; | 9 | return null; | |
See real code fragment | See real code fragment |
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 |
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.9 |
Clone type | Type 2 |
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.areEqual(newValue, oldValue); |
| | ||||||
|
| 4 | return null; | ||||||
4 | return false; |
| |
Row | Violation |
---|---|
1 | Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement return dataTypeObject.getDefaultValue(dbDefaultValue); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
3 | Unmatched return dataTypeObject.getDefaultValue(dbDefaultValue); |
4 | Unmatched statement return dataTypeObject.areEqual(newValue,oldValue); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched return dataTypeObject.areEqual(newValue,oldValue); |
6 | Unmatched return null; |
7 | Unmatched return false; |