* @throws NumberFormatException if rowStr is not parseable as an integer
*/
public static boolean isRowWithinRange(String rowStr, SpreadsheetVersion ssVersion) {
- final int rowNum = Integer.parseInt(rowStr) - 1;
- return isRowWithinRange(rowNum, ssVersion);
+ final long rowNum = Long.parseLong(rowStr) - 1;
+ if(rowNum > Integer.MAX_VALUE) {
+ return false;
+ }
+ return isRowWithinRange((int)rowNum, ssVersion);
}
/**
assertFalse("1 beyond last row", CellReference.isRowWithinRange(1048576, ss));
}
- @Test(expected=NumberFormatException.class)
+ @Test
public void isRowWithinRangeNonInteger_BigNumber() {
String rowNum = "4000000000";
- CellReference.isRowWithinRange(rowNum, SpreadsheetVersion.EXCEL2007);
+ assertFalse(CellReference.isRowWithinRange(rowNum, SpreadsheetVersion.EXCEL2007));
}
@Test(expected=NumberFormatException.class)