IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
// if no DataType object, then there is nothing to handle File IO,
// so cannot do it
if (dataTypeObject == null)
throw new IOException(
"No internal Data Type class for this column's SQL type");
// let DataType object speak for itself
return dataTypeObject.importObject(inStream);
IDataTypeComponent dataTypeObject = getDataTypeObject(null, colDef);
// if no DataType object, then there is nothing to handle File IO,
// so cannot do it
if (dataTypeObject == null)
throw new IOException(
"No internal Data Type class for this column's SQL type");
// let DataType object speak for itself
dataTypeObject.exportObject(outStream, text);
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: String importObject(ColumnDisplayDefinition, FileInputStream)
|
|
Method name: void exportObject(ColumnDisplayDefinition, FileOutputStream, String)
|
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 no DataType object, then there is nothing to handle File IO,↵ | | 3 | // if no DataType object, then there is nothing to handle File IO,↵
|
4 | // so cannot do it↵ | | 4 | // so cannot do it↵
|
5 | if (dataTypeObject == null)↵ | | 5 | if (dataTypeObject == null)↵
|
6 | throw new IOException(↵ | | 6 | throw new IOException(↵
|
7 | "No internal Data Type class for this column's SQL type");↵ | | 7 | "No internal Data Type class for this column's SQL type");↵
|
|
8 | // let DataType object speak for itself↵ | | 8 | // let DataType object speak for itself↵
|
9 | return dataTypeObject.importObject(inStream); | | 9 | dataTypeObject.exportObject(outStream, text);
|
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 | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.8 |
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 | throw new IOException("No internal Data Type class for this column's SQL type"); | | 3 | throw new IOException("No internal Data Type class for this column's SQL type"); |
| | | 4 | dataTypeObject.exportObject(outStream, text); |
4 | return dataTypeObject.importObject(inStream); | | | |
Precondition Violations (3)
Row |
Violation |
1 | Unmatched statement dataTypeObject.exportObject(outStream,text); 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.importObject(inStream); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return dataTypeObject.importObject(inStream); |