Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Gregory Shimansky
2006/8/15, Jimmy, Jing Lv [EMAIL PROTECTED]: IMHO our Compatibility guidelines, if the spec is not clear, we should follow RI. So no matter what happens to the spec(unless it describe the detail condition of exception-thrown), it is still OK to follow RI here, am I right? Ok you didn't

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Ivan Volosyuk
+1 for the following check: a) offset is negative or b) len is negative or c) off + len buff.length -- Ivan On 8/14/06, Geir Magnusson Jr [EMAIL PROTECTED] wrote: Ivan Volosyuk wrote: It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of

[drlvm][jni] Summary of Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-15 Thread Geir Magnusson Jr
So to summarize so we can close this. I assume that we all agree that the JNI spec is lacking, and that we should follow the RI as it's reasonable behavior. Gregory has added a patch to HARMONY-1156 and I'm going to accept and apply that. If there is any opposition, please speak now. geir

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Ivan Volosyuk wrote: It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of boundary checks makes sense here. This is an interesting problem. The JNI spec is clear that we should throw an exception when one of the indexes isn't valid, and start ==

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Gregory Shimansky
On Monday 14 August 2006 20:13 Geir Magnusson Jr wrote: Ivan Volosyuk wrote: It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of boundary checks makes sense here. This is an interesting problem. The JNI spec is clear that we should throw an

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Gregory Shimansky wrote: On Monday 14 August 2006 20:13 Geir Magnusson Jr wrote: Ivan Volosyuk wrote: It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of boundary checks makes sense here. This is an interesting problem. The JNI spec is clear

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Gregory Shimansky
On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GettypeArrayRegion with start equal to array length but throws AIOOBE if start is greater than array length.

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Jimmy, Jing Lv
Gregory Shimansky wrote: On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GettypeArrayRegion with start equal to array length but throws AIOOBE if start is greater

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Paulex Yang
Please correct me if I'm wrong, I thought what you mentioned as compatibility guideline is this[1], as the url shows, it's so far only classlib compatibility guideline, though I guess most of them makes sense for VM, but we may need some discussion to decide, let the VM developers speak for

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Geir Magnusson Jr
Gregory Shimansky wrote: On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GettypeArrayRegion with start equal to array length but throws AIOOBE if start is

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-14 Thread Paulex Yang
Gregory Shimansky wrote: On Monday 14 August 2006 23:37 Geir Magnusson Jr wrote: I've written a test [1] myself and cannot say I completely understand the result. With length = 0 RI 1.5 allows calling to GettypeArrayRegion with start equal to array length but throws AIOOBE if start is

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-12 Thread Ivan Volosyuk
It looks like that it is possible to get zero bytes even at the very end of array. IMHO the order of boundary checks makes sense here. -- Ivan On 8/11/06, Gregory Shimansky [EMAIL PROTECTED] wrote: 2006/8/11, Jimmy, Jing Lv [EMAIL PROTECTED]: Hi, As discussed in the former thread, I

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Tim Ellison
Jimmy, Jing Lv wrote: Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing parameter (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM throws an ArrayIndexOutOfBoundsException. IMHO, it is better to

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Geir Magnusson Jr
I think we should just fix it in DRLVM, although performance-wise, wouldn't also fixing in Java make sense too? As Tim said, raise a JIRA. geir Jimmy, Jing Lv wrote: Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing

Re: [DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-11 Thread Gregory Shimansky
2006/8/11, Jimmy, Jing Lv [EMAIL PROTECTED]: Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing parameter (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM throws an ArrayIndexOutOfBoundsException. IMHO,

Re: Exceptions found while running servlet...

2006-08-10 Thread Jimmy, Jing Lv
Martin Cordova wrote: Is it OK to send this type of feedback to the list? please let me know if not, and what subject conventions should I use (is there a link about this?). I am not a Harmony developer, just a new user, I can only provide feedback from my tests. Welcome! I think everyone

Re: Exceptions found while running servlet...

2006-08-10 Thread Tim Ellison
Jimmy, Jing Lv wrote: Oops, this is certainly wrong: offset = buffer.length,count = buffer.length - offset, the equal mark should be omitted. I'll raise a JIRA for this. I'm not sure if this is the cause of the problem. So would you please try again if I correct it? :) If you raise a

Re: Exceptions found while running servlet...

2006-08-10 Thread Martin Cordova
Hello, Rick Knowles, the author of Winstone servlet engine, replied to my email with this information: Martin, I think this is because winstone will sometimes do a outputstream.write(arr, 0, 0), because the content length is actually zero. It's likely that this is swallowed invisibly by IBM

Re: Exceptions found while running servlet...

2006-08-10 Thread Martin Cordova
I am using the JRE snapshot (I did not build anything, just unpacked a ZIP): pre-alpha : not complete or compatible svn = r428649, (Aug 4 2006), Windows/ia32/msvc 1310, release build This is what I downloaded: * http://people.apache.org/dist/incubator/harmony/snapshots/latest-jre-windows.zip

Re: Exceptions found while running servlet...

2006-08-10 Thread Oleg Khaschansky
Hmm, probably, you should try to set JAVA_HOME=c:\harmony\ On 8/10/06, Martin Cordova [EMAIL PROTECTED] wrote: I am using the JRE snapshot (I did not build anything, just unpacked a ZIP): pre-alpha : not complete or compatible svn = r428649, (Aug 4 2006), Windows/ia32/msvc 1310, release

Re: Exceptions found while running servlet...

2006-08-10 Thread Oleg Khaschansky
Unfortunately, imageio is not implemented yet. On 8/10/06, Martin Cordova [EMAIL PROTECTED] wrote: Oleg: I added that line, but still cannot find the class, the JVM prints this log msg: Loading of javax/imageio/ImageIO class failed due to java/lang/ClassNotFoundException Which JAR should I

Re: Exceptions found while running servlet...

2006-08-10 Thread Geir Magnusson Jr
Martin Cordova wrote: Is it OK to send this type of feedback to the list? ABSOLUTELY! please let me know if not, and what subject conventions should I use (is there a link about this?). I am not a Harmony developer, just a new user, I can only provide feedback from my tests.

[DRLVM][JNI]GetByteArrayRegion differs from RI (was Re: Exceptions found while running servlet...)

2006-08-10 Thread Jimmy, Jing Lv
Hi, As discussed in the former thread, I find that a JNI of DRLVM (GetByteArrayRegion) differs from RI in passing parameter (byte[count],count,0). RI (and J9 VM) returns immediately but DRLVM throws an ArrayIndexOutOfBoundsException. IMHO, it is better to improve here, make it follow