Skip to content

Commit

Permalink
Correct javadoc error
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Rhodes committed Nov 20, 2016
1 parent 6816cbf commit b44c25f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions memory/src/main/java/com/yahoo/memory/UnsafeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,27 +115,31 @@ private UnsafeUtil() {}
/**
* Perform bounds checking using java assert (if enabled) checking the requested offset and length
* against the allocated size.
* If reqOff + reqLen > allocSize or any of the parameters are negative an exception will be thrown.
* If reqOff + reqLen > allocSize or any of the parameters are negative an exception will
* be thrown.
* @param reqOff the requested offset
* @param reqLen the requested length
* @param allocSize the allocated size.
*/
public static void assertBounds(final long reqOff, final long reqLen, final long allocSize) {
assert ((reqOff | reqLen | (reqOff + reqLen) | (allocSize - (reqOff + reqLen))) >= 0) :
"offset: " + reqOff + ", reqLength: " + reqLen + ", size: " + allocSize;
"reqOffset: " + reqOff + ", reqLength: " + reqLen
+ ", (reqOff + reqLen): " + (reqOff + reqLen) + ", allocSize: " + allocSize;
}

/**
* Check the requested offset and length against the allocated size.
* If reqOff + reqLen > allocSize or any of the parameters are negative an exception will be thrown.
* If reqOff + reqLen > allocSize or any of the parameters are negative an exception will
* be thrown.
* @param reqOff the requested offset
* @param reqLen the requested length
* @param allocSize the allocated size.
*/
public static void checkBounds(final long reqOff, final long reqLen, final long allocSize) {
if ((reqOff | reqLen | (reqOff + reqLen) | (allocSize - (reqOff + reqLen))) < 0) {
throw new IllegalArgumentException("offset: " + reqOff + ", reqLength: " + reqLen + ", size: "
+ allocSize);
throw new IllegalArgumentException(
"reqOffset: " + reqOff + ", reqLength: "
+ ", (reqOff + reqLen): " + (reqOff + reqLen) + ", allocSize: " + allocSize);
}
}

Expand Down

0 comments on commit b44c25f

Please sign in to comment.