Yes .. we should just make it a code practice - never assert on is.read() /
os.write() :).

I hope this is the sort of bugs that you get to introduce only once :).

Shai

On Sat, Jun 12, 2010 at 2:03 PM, Uwe Schindler <[email protected]> wrote:

> This is hard to find! It only fails with disabled assertions, so the lucene
> test suite always passes - ugly :(
>
> Thanks!
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: [email protected]
>
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]]
> > Sent: Saturday, June 12, 2010 12:48 PM
> > To: [email protected]
> > Subject: svn commit: r953986 -
> > /lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.
> > java
> >
> > Author: shaie
> > Date: Sat Jun 12 10:47:35 2010
> > New Revision: 953986
> >
> > URL: http://svn.apache.org/viewvc?rev=953986&view=rev
> > Log:
> > LUCENE-2497: fix a bug that was introduced in LUCENE-2480
> >
> > Modified:
> >
> > lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.j
> > ava
> >
> > Modified:
> > lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.j
> > ava
> > URL:
> > http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/java/org/apach
> > e/lucene/index/SegmentInfo.java?rev=953986&r1=953985&r2=953986&view
> > =diff
> > ==========================================================
> > ====================
> > ---
> > lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.j
> > ava (original)
> > +++
> > lucene/dev/trunk/lucene/src/java/org/apache/lucene/index/SegmentInfo.j
> > ava Sat Jun 12 10:47:35 2010
> > @@ -154,7 +154,8 @@ public final class SegmentInfo {
> >      }
> >      if (format > SegmentInfos.FORMAT_4_0) {
> >        // pre-4.0 indexes write a byte if there is a single norms file
> > -      assert 1 == input.readByte();
> > +      byte b = input.readByte();
> > +      assert 1 == b;
> >      }
> >      int numNormGen = input.readInt();
> >      if (numNormGen == NO) {
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to