Skip to content

Commit 5726713

Browse files
committed
refine conditions
1 parent 773ad5e commit 5726713

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

poi/src/main/java/org/apache/poi/hpsf/TypedPropertyValue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void skipPadding( LittleEndianByteArrayInputStream lei ) {
255255
for (int i=0; i<skipBytes; i++) {
256256
lei.mark(1);
257257
int b = lei.read();
258-
if (b == -1 || b != 0) {
258+
if (b != 0) {
259259
lei.reset();
260260
break;
261261
}

poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFSheet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,7 @@ private void setRepeatingRowsAndColumns(
25522552
if (rowDef != null) {
25532553
row1 = rowDef.getFirstRow();
25542554
row2 = rowDef.getLastRow();
2555-
if ((row1 == -1 && row2 != -1) || (row1 > row2)
2555+
if ((row1 > row2)
25562556
|| (row1 < 0 || row1 > maxRowIndex)
25572557
|| (row2 < 0 || row2 > maxRowIndex)) {
25582558
throw new IllegalArgumentException("Invalid row range specification");
@@ -2561,7 +2561,7 @@ private void setRepeatingRowsAndColumns(
25612561
if (colDef != null) {
25622562
col1 = colDef.getFirstColumn();
25632563
col2 = colDef.getLastColumn();
2564-
if ((col1 == -1 && col2 != -1) || (col1 > col2)
2564+
if ((col1 > col2)
25652565
|| (col1 < 0 || col1 > maxColIndex)
25662566
|| (col2 < 0 || col2 > maxColIndex)) {
25672567
throw new IllegalArgumentException("Invalid column range specification");

0 commit comments

Comments
 (0)