修复提示信息错误

This commit is contained in:
Looly
2022-08-30 21:53:45 +08:00
parent 7ddcc117fd
commit c5911c0501
4 changed files with 34 additions and 1 deletions

View File

@@ -44,7 +44,9 @@ public class MapSheetReader extends AbstractSheetReader<List<Map<String, Object>
if (headerRowIndex < firstRowNum) {
throw new IndexOutOfBoundsException(StrUtil.format("Header row index {} is lower than first row index {}.", headerRowIndex, firstRowNum));
} else if (headerRowIndex > lastRowNum) {
throw new IndexOutOfBoundsException(StrUtil.format("Header row index {} is greater than last row index {}.", headerRowIndex, firstRowNum));
throw new IndexOutOfBoundsException(StrUtil.format("Header row index {} is greater than last row index {}.", headerRowIndex, lastRowNum));
} else if (startRowIndex > lastRowNum) {
throw new IndexOutOfBoundsException(StrUtil.format("startRowIndex row index {} is greater than last row index {}.", startRowIndex, lastRowNum));
}
final int startRowIndex = Math.max(this.startRowIndex, firstRowNum);// 读取起始行(包含)
final int endRowIndex = Math.min(this.endRowIndex, lastRowNum);// 读取结束行(包含)