Skip to content

Apache Lucene open-source search software

LUCENE-10114: Remove unused byte order mark in Lucene90PostingsWriter (#309)

Uwe Schindler075d801abe46
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index d786c40b747..9dc16e419fc 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -315,6 +315,9 @@ Bug fixes
* LUCENE-10101, LUCENE-9281: Use getField() instead of getDeclaredField() to
minimize security impact by analysis SPI discovery. (Uwe Schindler)
+* LUCENE-10114: Remove unused byte order mark in Lucene90PostingsWriter. This
+ was initially introduced by accident in Lucene 8.4. (Uwe Schindler)
+
Changes in Backwards Compatibility Policy
* LUCENE-9904: regenerated UAX29URLEmailTokenizer and the corresponding analyzer with up-to-date top
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsWriter.java
index 7e11b9408ad..f640d8d2c57 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90PostingsWriter.java
@@ -25,7 +25,6 @@ import static org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat.TERMS_COD
import static org.apache.lucene.codecs.lucene90.Lucene90PostingsFormat.VERSION_CURRENT;
import java.io.IOException;
-import java.nio.ByteOrder;
import org.apache.lucene.codecs.BlockTermState;
import org.apache.lucene.codecs.CodecUtil;
import org.apache.lucene.codecs.CompetitiveImpactAccumulator;
@@ -111,14 +110,6 @@ public final class Lucene90PostingsWriter extends PushPostingsWriterBase {
try {
CodecUtil.writeIndexHeader(
docOut, DOC_CODEC, VERSION_CURRENT, state.segmentInfo.getId(), state.segmentSuffix);
- ByteOrder byteOrder = ByteOrder.nativeOrder();
- if (byteOrder == ByteOrder.BIG_ENDIAN) {
- docOut.writeByte((byte) 'B');
- } else if (byteOrder == ByteOrder.LITTLE_ENDIAN) {
- docOut.writeByte((byte) 'L');
- } else {
- throw new Error();
- }
pforUtil = new PForUtil(new ForUtil());
if (state.fieldInfos.hasProx()) {
posDeltaBuffer = new long[BLOCK_SIZE];