GP-0 DB exception improvements/cleanup

This commit is contained in:
ghidra1 2023-02-17 22:05:20 -05:00
parent 4b50ba28a9
commit a9f778ddb0
32 changed files with 324 additions and 215 deletions

View file

@ -125,7 +125,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
return true;
}
public int setBytes(ByteBuffer buf, int dstOffset, int len, int blockNum) throws IOException {
public int setBytes(ByteBuffer buf, int dstOffset, int len, int blockNum)
throws IndexOutOfBoundsException, IOException {
assert isSane(dstOffset, len, blockNum);
if (compressed) {
decompress();
@ -136,7 +137,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
return len;
}
public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum) throws IOException {
public int getBytes(ByteBuffer buf, int srcOffset, int len, int blockNum)
throws IndexOutOfBoundsException, IOException {
assert isSane(srcOffset, len, blockNum);
if (compressed) {
return doGetCompressedBytes(buf, srcOffset, len, blockNum);
@ -161,7 +163,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
}
}
protected void doGetBlock(int blockNum, byte[] data) throws IOException {
protected void doGetBlock(int blockNum, byte[] data)
throws IndexOutOfBoundsException, IOException {
assert isInUse(blockNum);
if (compressed) {
doGetCompressedBlock(blockNum, data);
@ -180,7 +183,7 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
}
public void copyFrom(int dstBlockNum, DBTraceMemoryBufferEntry srcBuf, int srcBlockNum)
throws IOException {
throws IndexOutOfBoundsException, IOException {
assert isInUse(dstBlockNum);
if (compressed) {
decompress();
@ -190,7 +193,8 @@ public class DBTraceMemoryBufferEntry extends DBAnnotatedObject {
buffer.put(dstBlockNum << DBTraceMemorySpace.BLOCK_SHIFT, data);
}
public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum) throws IOException {
public int cmpBytes(ByteBuffer buf, int blkOffset, int len, int blockNum)
throws IndexOutOfBoundsException, IOException {
assert isSane(blkOffset, len, blockNum);
if (compressed) {
return doCmpCompressedBytes(buf, blkOffset, len, blockNum);