From: Josh Micich Date: Fri, 21 Mar 2008 23:47:51 +0000 (+0000) Subject: sort to int conversion sign extension fix X-Git-Tag: REL_3_0_3_BETA1~76 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=edd0857f663db14767d0d6579050b11cfd83bc71;p=poi.git sort to int conversion sign extension fix git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@639918 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java index 66f79ffd8a..75452dd945 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)