if ((int) pos <= 0) {
throw new SqlException(agent_.logWriter_,
new MessageId(SQLState.BLOB_BAD_POSITION), new Long(pos));
}
Is the casting of pos from long to int safe ? Consider the case if pos
is > Integer.MAXINT. Is it intentional that pos > Integer.MAXINT gives
this exception ?
How about:
> if (pos <= 0L) {
> throw new SqlException(agent_.logWriter_,
> new MessageId(SQLState.BLOB_BAD_POSITION), new Long(pos));
> }
or if it is intentional to give an exception if pos is bigger than
Integer.MAXINT, one could write it more explicitly:
> if (pos <= 0L || pos >= MAXPOS) {
> throw new SqlException(agent_.logWriter_,
> new MessageId(SQLState.BLOB_BAD_POSITION), new Long(pos));
> }
Andreas