Index: java/org/apache/lucene/document/Field.java =================================================================== --- java/org/apache/lucene/document/Field.java (revision 636100) +++ java/org/apache/lucene/document/Field.java (working copy) @@ -148,7 +148,7 @@ /** The value of the field in Binary, or null. If null, the Reader value, * String value, or TokenStream value is used. Exactly one of stringValue(), * readerValue(), binaryValue(), and tokenStreamValue() must be set. */ - public byte[] binaryValue() { return fieldsData instanceof byte[] ? (byte[])fieldsData : null; } + public byte[] binaryValue() { return isBinary ? (byte[])fieldsData : null; } /** The value of the field as a TokesStream, or null. If null, the Reader value, * String value, or binary value is used. Exactly one of stringValue(), Index: java/org/apache/lucene/index/FieldsReader.java =================================================================== --- java/org/apache/lucene/index/FieldsReader.java (revision 636100) +++ java/org/apache/lucene/index/FieldsReader.java (working copy) @@ -426,11 +426,12 @@ } else { fieldsData = b; } + this.isBinary = true; } catch (IOException e) { throw new FieldReaderException(e); } } - return fieldsData instanceof byte[] ? (byte[]) fieldsData : null; + return this.isBinary ? (byte[]) fieldsData : null; } /** The value of the field as a Reader, or null. If null, the String value,