-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
P2
-
Affects Version/s: 21, 25, 26, 27
-
Component/s: client-libs
The specification for java.awt.image.DataBufferUShort does not clearly define the exceptions that may be thrown by several constructors and methods, leading to unspecified behavior.
Constructors
As and example the following constructors do not specify the exceptions they may throw for invalid inputs:
DataBufferUShort(short[][] dataArray, int size)
DataBufferUShort(short[][] dataArray, int size, int[] offsets)
These constructors should explicitly specify that a NullPointerException is thrown when dataArray is null for example.
Additionally, the constructor:
DataBufferUShort(int size, int numBanks)
does not specify the behavior when negative/OutOfBounds values are passed for size or numBanks. It is unclear whether a NegativeArraySizeException or an ArrayIndexOutOfBoundsException is expected in such cases.
Methods
For the following methods:
getElem(...)
getData(...)
setElem(...)
the specification should explicitly state that an ArrayIndexOutOfBoundsException is thrown when:
- the bank index is invalid (less than 0 or greater than or equal to numBanks), or
- the element index is invalid (less than 0 or greater than or equal to size).
Constructors
As and example the following constructors do not specify the exceptions they may throw for invalid inputs:
DataBufferUShort(short[][] dataArray, int size)
DataBufferUShort(short[][] dataArray, int size, int[] offsets)
These constructors should explicitly specify that a NullPointerException is thrown when dataArray is null for example.
Additionally, the constructor:
DataBufferUShort(int size, int numBanks)
does not specify the behavior when negative/OutOfBounds values are passed for size or numBanks. It is unclear whether a NegativeArraySizeException or an ArrayIndexOutOfBoundsException is expected in such cases.
Methods
For the following methods:
getElem(...)
getData(...)
setElem(...)
the specification should explicitly state that an ArrayIndexOutOfBoundsException is thrown when:
- the bank index is invalid (less than 0 or greater than or equal to numBanks), or
- the element index is invalid (less than 0 or greater than or equal to size).
- relates to
-
JDK-4393297 Doc probs in java.awt.image.DataBufferInt
-
- Open
-
-
JDK-4398379 java.awt.image.DataBufferShort constructor should verify size of array
-
- Open
-
-
JDK-4398381 java.awt.image.DataBufferShort should check for negative size
-
- Open
-
-
JDK-4398388 Doc probs in java.awt.image.DataBufferUShort
-
- Closed
-