diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java index 66f79ffd8..75452dd94 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java @@ -296,9 +296,9 @@ public final class HSSFRow implements Comparable { * @param cellnum 0 based column number * @return HSSFCell representing that column or null if undefined. */ - public HSSFCell getCell(short cellnum) - { - return getCell((int)cellnum); + public HSSFCell getCell(short cellnum) { + int ushortCellNum = cellnum & 0x0000FFFF; // avoid sign extension + return getCell(ushortCellNum); } /** * Get the hssfcell representing a given column (logical cell)