Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 96296 invoked from network); 14 Dec 2006 15:28:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2006 15:28:27 -0000 Received: (qmail 26206 invoked by uid 500); 14 Dec 2006 15:28:28 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 26177 invoked by uid 500); 14 Dec 2006 15:28:28 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 26106 invoked by uid 99); 14 Dec 2006 15:28:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 07:28:27 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of zhanghuangzhu@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Dec 2006 07:28:17 -0800 Received: by ug-out-1314.google.com with SMTP id z36so443741uge for ; Thu, 14 Dec 2006 07:27:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=nEFQjMYy7NSOSZywrqLDejG1y1J7MUmLGQ4EaiQnqKuC++jDB22GzR5CkE6z/bcw7J/mBdOn2b7UbEV3H0cTzBBeyWpOd335Wne3NzZr8g2g1OrCoPJlNbJOysJzelIXZbAfLFGL7P03q/2bQ2rsG5if4zQi6gNJKG08PbR17EQ= Received: by 10.82.136.4 with SMTP id j4mr273672bud.1166110074632; Thu, 14 Dec 2006 07:27:54 -0800 (PST) Received: by 10.82.115.8 with HTTP; Thu, 14 Dec 2006 07:27:54 -0800 (PST) Message-ID: <4d0b24970612140727r24e8edeak6a15c1b67659f0f6@mail.gmail.com> Date: Thu, 14 Dec 2006 23:27:54 +0800 From: "Andrew Zhang" To: dev@harmony.apache.org Subject: Re: [classlib][sql] RI's bug of SerialBlob.position(byte[] pattern, long start)? In-Reply-To: <4d0b24970612131906o8d8e946n34213feb7e06ebb6@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_25297_13557342.1166110074600" References: <4d0b24970612120021y1f6b97d2v6801798dd2b01161@mail.gmail.com> <26c14c2a0612120644w3541fea2s3d6d061f335d9120@mail.gmail.com> <4d0b24970612130124t45cf3264q77bb52d42d212fa6@mail.gmail.com> <26c14c2a0612130328h1c7b137er2d206fa42a923e18@mail.gmail.com> <457FEBED.1040400@gmail.com> <2c9597b90612130515g394bae1byfd0df5cd8718f774@mail.gmail.com> <26c14c2a0612130545i1cb421a3gf197737004fe247b@mail.gmail.com> <2c9597b90612130607m41a6f3a1uaf01df9fa6164acc@mail.gmail.com> <26c14c2a0612130732r5fd27159x28703c225b2282bd@mail.gmail.com> <4d0b24970612131906o8d8e946n34213feb7e06ebb6@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_25297_13557342.1166110074600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guys, I've filed jira Harmony-2708, and followed spec for position(byte[], long) implementation. Thanks! On 12/14/06, Andrew Zhang wrote: > > Cool. Since we all agreed to do exact search, I'll follow this way to > implement position(byte[] pattern, long pos) in Harmony. :) > > On 12/13/06, Oleg Khaschansky wrote: > > > > > I wonder how Sun can release the code that is > > > completely broken? This is strange. > > Probably, SerialBlob.position(...) methods are not very popular. > > Simply noone noticed that they are broken. And noone needs to get a > > part of a BLOB into an array with getBytes, people tend to get the > > whole array and it works fine. > > > > On 12/13/06, Alexei Zakharov wrote: > > > It seems this is another RI's dark corner. The above tests look like > > > standard usage patterns for the position() method. Is there something > > > specific about them? I wonder how Sun can release the code that is > > > completely broken? This is strange. > > > > > > Regards, > > > > > > 2006/12/13, Oleg Khaschansky < oleg.v.khaschansky@gmail.com>: > > > > > BTW, what does the another version > > > > > of position() method - position(Blob pattern, long start) - > > return in > > > > > these cases? > > > > I tried the following: > > > > byte[] buf = { 1,3,9,1,1,3,2,2,4,2,3,9,3,3 }; > > > > SerialBlob blob = new SerialBlob(buf); > > > > > > > > byte[] pattern = new byte[] { 1,2,3 }; > > > > SerialBlob blob2 = new SerialBlob(pattern); > > > > long pos = blob.position(blob2, 1); > > > > System.out.println(pos); > > > > and, again, it returned 9. It seems like it does exactly the same as > > > > position(byte[] pattern, long start). > > > > > > > > Regarding its implementation, it's possible to simply get the byte > > > > array with pattern.getBytes(1, pattern.length()) and then use > > > > position(byte[] pattern, long start) with the obtained byte array. > > > > > > > > On 12/13/06, Alexei Zakharov wrote: > > > > > Looks like the RI bug to me also. BTW, what does the another > > version > > > > > of position() method - position(Blob pattern, long start) - > > return in > > > > > these cases? > > > > > > > > > > Thanks, > > > > > > > > > > 2006/12/13, Tim Ellison < t.p.ellison@gmail.com>: > > > > > > Oleg Khaschansky wrote: > > > > > > > I am not a guru, but my understanding is that RI behavior is > > > > > > > errorneous. I'd say that from the client point of view BLOBs > > are just > > > > > > > byte arrays. I suggest to do exact search instead of following > > RI. > > > > > > > > > > > > Same for me -- looks like the right answer but don't claim > > expert > > > > > > knowledge in the area. > > > > > > > > > > > > -- > > > Alexei Zakharov, > > > Intel ESSD > > > > > > > > > -- > Best regards, > Andrew Zhang -- Best regards, Andrew Zhang ------=_Part_25297_13557342.1166110074600--