Skip to content

Commit

Permalink
[NEMO-412] Address Sonar Cloud issue for MemoryChunk (apache#233)
Browse files Browse the repository at this point in the history
JIRA: [NEMO-412: Address Sonar Cloud issue for MemoryChunk](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-412)

**Major changes:**
- `checkIndex()` in `MemoryChunk` is fixed to return either true or false.

**Minor changes to note:**
- None

Closes apache#233
  • Loading branch information
hy00nc authored and wonook committed Sep 7, 2019
1 parent 6fe9e64 commit 0f10831
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,8 @@ public final void putDouble(final int index, final double value) {
putLong(index, Double.doubleToRawLongBits(value));
}

private boolean checkIndex(final int index, final long pos, final int typeSize) throws IndexOutOfBoundsException {
if (!(index >= 0 && pos <= addressLimit - typeSize)) {
throw new IndexOutOfBoundsException();
} else {
return true;
}
private boolean checkIndex(final int index, final long pos, final int typeSize) {
return (index >= 0 && pos <= (addressLimit - typeSize));
}

@SuppressWarnings("restriction")
Expand Down

0 comments on commit 0f10831

Please sign in to comment.