Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v6]

2021-10-28 Thread Mitsuru Kariya
On Sun, 24 Oct 2021 07:55:01 GMT, Mitsuru Kariya wrote: >> Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in >> the following cases: >> >> 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= >> this

Integrated: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert.

2021-10-28 Thread Mitsuru Kariya
On Wed, 12 May 2021 17:48:50 GMT, Mitsuru Kariya wrote: > Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in > the following cases: > > 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= > this.length()` >Th

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v6]

2021-10-27 Thread Mitsuru Kariya
On Sun, 24 Oct 2021 07:55:01 GMT, Mitsuru Kariya wrote: >> Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in >> the following cases: >> >> 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= >> this

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v6]

2021-10-24 Thread Mitsuru Kariya
>So, it should work correctly when pos == length+1 of the BLOB value. > > *3 The documentation of `Clob.setString()` says, "If the end of the Clob > value is eached while writing the given string, then the length of the Clob > value will be increased to accommodate the extra

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v5]

2021-10-18 Thread Mitsuru Kariya
On Fri, 15 Oct 2021 09:30:18 GMT, Mitsuru Kariya wrote: >> Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in >> the following cases: >> >> 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= >> this

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v5]

2021-10-15 Thread Mitsuru Kariya
>So, it should work correctly when pos == length+1 of the BLOB value. > > *3 The documentation of `Clob.setString()` says, "If the end of the Clob > value is eached while writing the given string, then the length of the Clob > value will be increased to accommodate

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v4]

2021-10-13 Thread Mitsuru Kariya
On Wed, 15 Sep 2021 17:57:35 GMT, Lance Andersen wrote: >> Mitsuru Kariya has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Modify javadoc for consistency > > src/java.sql.rowset/share/classes/javax/sql

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v3]

2021-05-24 Thread Mitsuru Kariya
On Tue, 18 May 2021 19:06:56 GMT, Lance Andersen wrote: > I have run the JCK tests in addition to to the JTREG Tess to validate there > are no additional failures due to these changes Thanks a lot! > src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SerialBlob.java > line 308: > >> 3

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v4]

2021-05-24 Thread Mitsuru Kariya
>So, it should work correctly when pos == length+1 of the BLOB value. > > *3 The documentation of `Clob.setString()` says, "If the end of the Clob > value is eached while writing the given string, then the length of the Clob > value will be increased to accommodate

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v3]

2021-05-24 Thread Mitsuru Kariya
On Tue, 18 May 2021 18:44:32 GMT, Lance Andersen wrote: >> Mitsuru Kariya has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix for length + offset > Integer.MAX_VALUE case > > src/java.sql.rowset/shar

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v3]

2021-05-17 Thread Mitsuru Kariya
while writing the given string, then the length of the Clob > value will be increased to accommodate the extra characters." > > *4 The documentation of `Clob.setString()` says, "If the value specified for > pos is greater than the length+1 of the CLOB value then the behavior is

Re: RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert. [v2]

2021-05-13 Thread Mitsuru Kariya
while writing the given string, then the length of the Clob > value will be increased to accommodate the extra characters." > > *4 The documentation of `Clob.setString()` says, "If the value specified for > pos is greater than the length+1 of the CLOB value the

RFR: 8153490: Cannot setBytes() if incoming buffer's length is bigger than number of elements we want to insert.

2021-05-12 Thread Mitsuru Kariya
Fix `SerialBlob.setBytes(long pos, byte[] bytes, int offset, int length)` in the following cases: 1. `pos - 1 + bytes.length - offset > this.length() && pos - 1 + length <= this.length()` The original implementation throws `ArrayIndexOutOfBoundsException` but this case should end successfull

Re: Would anyone please reopen JDK-4991002?

2021-05-12 Thread Mitsuru Kariya
e are better alternatives for an API. Once you have signed your OCA and have generated your proposed patch, feel free to create your PR. Best Lance On May 11, 2021, at 9:11 AM, Mitsuru Kariya wrote: Hi, While reading the source for SerialBlob, I found that SerialBlob.position() does not

SerialBlob.getBytes() may throw ArrayIndexOutOfBoundsException when pos > 1

2021-05-11 Thread Mitsuru Kariya
Hi, Please see the sample code below. SerialBlob sb = new SerialBlob(new byte[]{1, 2, 3}); System.out.println(Arrays.toString(sb.getBytes(3, 3))); I think that it should output "[3]" but the current implementation throws ArrayIndexOutOfBoundsException. If it's worth changing, could anyone su

SerialBlob has an inconsistency between equals() and hashCode()

2021-05-11 Thread Mitsuru Kariya
Hi, Please see the sample code below. SerialBlob sb1 = new SerialBlob(new byte[]{1, 2, 3}); SerialBlob sb2 = new SerialBlob(new byte[]{1, 2, 3, 4, 5}); sb2.truncate(3); System.out.println(sb1.equals(sb2)); System.out.println(sb1.hashCode() == sb2.hashCode()); I think that it should output "true

Would anyone please reopen JDK-4991002?

2021-05-11 Thread Mitsuru Kariya
Hi, While reading the source for SerialBlob, I found that SerialBlob.position() does not work correctly. So, I searched JBS and found the description in JDK-4991002 point 1, but it was closed by Cannot Reproduce. It can be reproduced easily like below. SerialBlob sb = new SerialBlob(new byte

May I make a pull request for JDK-8153490?

2021-05-11 Thread Mitsuru Kariya
Hi, While reading the SerialBlob source, I found that it's been over a year and a half since the JDK-8153490 was last updated. Furthermore, according to the documentation of Blog.setBytes() (not SerialBlob.setBytes()), there are the following problems: 1. It says "If the end of the Blob val