Index: lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java =================================================================== --- lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java (revision 1431554) +++ lucene/test-framework/src/java/org/apache/lucene/util/fst/FSTTester.java (working copy) @@ -289,6 +289,13 @@ null, willRewrite, true); + if (LuceneTestCase.VERBOSE) { + if (willRewrite) { + System.out.println("TEST: packed FST"); + } else { + System.out.println("TEST: non-packed FST"); + } + } for(InputOutput pair : pairs) { if (pair.output instanceof List) { Index: lucene/core/src/java/org/apache/lucene/util/fst/FST.java =================================================================== --- lucene/core/src/java/org/apache/lucene/util/fst/FST.java (revision 1431554) +++ lucene/core/src/java/org/apache/lucene/util/fst/FST.java (working copy) @@ -656,7 +656,7 @@ if (targetHasArcs && (flags & BIT_TARGET_NEXT) == 0) { assert target.node > 0; //System.out.println(" write target"); - writer.writeInt(target.node); + writer.writeVInt(target.node); } // just write the arcs "like normal" on first pass, @@ -805,11 +805,9 @@ if (arc.flag(BIT_STOP_NODE)) { } else if (arc.flag(BIT_TARGET_NEXT)) { } else { - if (packed) { - in.readVInt(); - } else { - in.skip(4); - } + // nocommit this is a BW break? how come we + // don't see fails from TestBackCompat!? + in.readVInt(); } arc.flags = in.readByte(); } @@ -921,8 +919,10 @@ int pos = in.pos = getNodeAddress(arc.nextArc); final byte b = in.readByte(); if (b == ARCS_AS_FIXED_ARRAY) { - //System.out.println(" nextArc fake array"); + //System.out.println(" nextArc fixed array"); in.readVInt(); + + // Skip bytesPerArc: if (packed) { in.readVInt(); } else { @@ -1024,7 +1024,7 @@ //System.out.println(" abs code=" + code + " derefLen=" + nodeRefToAddress.length); } } else { - arc.target = in.readInt(); + arc.target = in.readVInt(); } arc.nextArc = in.pos; } @@ -1144,11 +1144,7 @@ } if (!flag(flags, BIT_STOP_NODE) && !flag(flags, BIT_TARGET_NEXT)) { - if (packed) { - in.readVInt(); - } else { - in.readInt(); - } + in.readVInt(); } if (flag(flags, BIT_LAST_ARC)) {