Fwd: Re: found bug in BMByteSearch.java
Mathieu Peltier <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.general |
|---|---|
| Organization | INRIA |
| Message-ID | <[email protected]> |
On Wednesday 03 September 2003 13:18, [email protected] wrote: > Dear Enydra-Developer, > > sometime ago I downloaded a Java-Class called BMByteSearch.java and > realised that there was an simple bug, > which caused an ArrayOutOfBoundsException in the method > genPatternFromByteArray(byte[] bytes, int off, int length). > The Exception happens, when I set a byte-Pattern in > BMByteSearch(byte[]) > for example new BMByteSearch(new byte[]{0x88}); > > Below you see a possible solution for this problem. I hope you will > think about your next bugfix. > > /** > * Generates the pattern byte string <code>P</code> from a portion > * of another byte string. > * > * @param bytes The byte string from which to extract the pattern. > * @param off The array index within <code>bytes</code> from > * which to extract the pattern. > * @param length The number of characters to extract from > * <code>bytes</code> into the pattern. > */ > private final > void genPatternFromByteArray(byte[] bytes, int off, int length) > { > int i,j; > m = length; > P = new byte[m + 1]; > for (i=1, j=off; i <= length; i++, j++) P[i] = bytes[j]; > } > > > regards Fenn Stefan Hi, I think the best thing to do is to submit your patch directly to the Enhydra's ObjectWeb Forge project page. It seems that someone (you?) has already posted a fix for this bug: http://forge.objectweb.org/patch/?func=detailpatch&patch_id=3&group_id=21 So I forward your mail to the enhydra mailing list. (Enhydra developpers should normally receive a notification when a patch is submitted) Thanks, Best regards, -- Mathieu Peltier INRIA Rhône-Alpes - ObjectWeb Consortium http://www.inrialpes.fr/ - http://www.objectweb.org/