checkPointer(); Cell cell = sheet.getCell(column, pointer); if (cell.getType() != CellType.DATE) { throw new UnsupportedFormatException(); } return ((DateCell) cell).getDate();
checkPointer(); Cell cell = sheet.getCell(column, pointer); if (cell.getType() != CellType.NUMBER) { throw new UnsupportedFormatException(); } return (new Double(((NumberCell) cell).getValue())).intValue();
Clone fragments detected by clone detection tool
File path: /sql12/plugins/dataimport/src/net/sourceforge/squirrel_sql/plugins/dataimport/importer/excel/ExcelFileImporter.java File path: /sql12/plugins/dataimport/src/net/sourceforge/squirrel_sql/plugins/dataimport/importer/excel/ExcelFileImporter.java
Method name: Date getDate(int) Method name: Integer getInt(int)
Number of AST nodes: 5 Number of AST nodes: 5
1
checkPointer();
1
checkPointer();
2
		Cell cell = sheet.getCell(column, pointer);
2
		Cell cell = sheet.getCell(column, pointer);
3
		if (cell.getType() != CellType.DATE) {
3
		if (cell.getType() != CellType.NUMBER) {
4
			throw new UnsupportedFormatException();
4
			throw new UnsupportedFormatException();
5
		}
5
		}
6
		return ((DateCell) cell).getDate();
6
		return (new Double(((NumberCell) cell).getValue())).intValue();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    checkPointer();
    1
    checkPointer();
    2
    Cell cell = sheet.getCell(column, pointer);
    2
    Cell cell = sheet.getCell(column, pointer);
    3
    if (cell.getType() != CellType.DATE)
    3
    if (cell.getType() != CellType.DATE)
    3
    if (cell.getType() != CellType.NUMBER)
    Differences
    Expression1Expression2Difference
    DATENUMBERVARIABLE_NAME_MISMATCH
    3
    if (cell.getType() != CellType.NUMBER)
    4
    throw new UnsupportedFormatException();
    4
    throw new UnsupportedFormatException();
                                                                                                                                      
    5
    return (new Double(((NumberCell)cell).getValue())).intValue();
    Preondition Violations
    Unmatched statement return (new Double(((NumberCell)cell).getValue())).intValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return (new Double(((NumberCell)cell).getValue())).intValue();
    5
    return (new Double(((NumberCell)cell).getValue())).intValue();
    5
    return ((DateCell)cell).getDate();
    5
    return ((DateCell)cell).getDate();
    Preondition Violations
    Unmatched statement return ((DateCell)cell).getDate(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched return ((DateCell)cell).getDate();
                                                                              
    Precondition Violations (4)
    Row Violation
    1Unmatched statement return (new Double(((NumberCell)cell).getValue())).intValue(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched return (new Double(((NumberCell)cell).getValue())).intValue();
    3Unmatched statement return ((DateCell)cell).getDate(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched return ((DateCell)cell).getDate();