From 0caa9474833a224060b9e4deefb7e0b171a8f273 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 30 Jul 2015 02:53:59 +0200 Subject: Bitfield: Use IndexOutOfBoundsException instead of ArrayIndexOutOfBoundsException --- src/java/jogamp/common/util/Int32Bitfield.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/java/jogamp/common/util/Int32Bitfield.java') diff --git a/src/java/jogamp/common/util/Int32Bitfield.java b/src/java/jogamp/common/util/Int32Bitfield.java index 28faf2c..f81b486 100644 --- a/src/java/jogamp/common/util/Int32Bitfield.java +++ b/src/java/jogamp/common/util/Int32Bitfield.java @@ -49,32 +49,32 @@ public class Int32Bitfield implements Bitfield { return UNIT_SIZE; } - private final void check(final int limit, final int bitnum) throws ArrayIndexOutOfBoundsException { + private final void check(final int limit, final int bitnum) throws IndexOutOfBoundsException { if( 0 > bitnum || bitnum >= limit ) { - throw new ArrayIndexOutOfBoundsException("Bitnum should be within [0.."+(limit-1)+"], but is "+bitnum); + throw new IndexOutOfBoundsException("Bitnum should be within [0.."+(limit-1)+"], but is "+bitnum); } } @Override - public final int getInt32(final int rightBitnum) throws ArrayIndexOutOfBoundsException { + public final int getInt32(final int rightBitnum) throws IndexOutOfBoundsException { check(UNIT_SIZE-31, rightBitnum); return storage; } @Override - public final void putInt32(final int rightBitnum, final int mask) throws ArrayIndexOutOfBoundsException { + public final void putInt32(final int rightBitnum, final int mask) throws IndexOutOfBoundsException { check(UNIT_SIZE-31, rightBitnum); storage = mask; } @Override - public final boolean get(final int bitnum) throws ArrayIndexOutOfBoundsException { + public final boolean get(final int bitnum) throws IndexOutOfBoundsException { check(UNIT_SIZE, bitnum); return 0 != ( storage & ( 1 << bitnum ) ) ; } @Override - public final boolean put(final int bitnum, final boolean bit) throws ArrayIndexOutOfBoundsException { + public final boolean put(final int bitnum, final boolean bit) throws IndexOutOfBoundsException { check(UNIT_SIZE, bitnum); final int m = 1 << bitnum; final boolean prev = 0 != ( storage & m ) ; @@ -88,13 +88,13 @@ public class Int32Bitfield implements Bitfield { return prev; } @Override - public final void set(final int bitnum) throws ArrayIndexOutOfBoundsException { + public final void set(final int bitnum) throws IndexOutOfBoundsException { check(UNIT_SIZE, bitnum); final int m = 1 << bitnum; storage |= m; } @Override - public final void clear (final int bitnum) throws ArrayIndexOutOfBoundsException { + public final void clear (final int bitnum) throws IndexOutOfBoundsException { check(UNIT_SIZE, bitnum); final int m = 1 << bitnum; storage &= ~m; -- cgit v1.2.3