Index: solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java =================================================================== --- solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (revision 1390018) +++ solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (working copy) @@ -451,7 +451,7 @@ } @Override - public void binaryField(FieldInfo fieldInfo, byte[] value, int offset, int length) throws IOException { + public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { doc.add(new StoredField(fieldInfo.name, value)); } Index: lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java =================================================================== --- lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java (revision 1390018) +++ lucene/core/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java (working copy) @@ -188,7 +188,7 @@ byte bytes[] = new byte[length]; fieldsStream.readBytes(bytes, 0, length); if ((bits & FIELD_IS_BINARY) != 0) { - visitor.binaryField(info, bytes, 0, bytes.length); + visitor.binaryField(info, bytes); } else { visitor.stringField(info, new String(bytes, 0, bytes.length, IOUtils.CHARSET_UTF_8)); } Index: lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java =================================================================== --- lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java (revision 1390018) +++ lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java (working copy) @@ -41,8 +41,10 @@ protected StoredFieldVisitor() { } - /** Process a binary field. */ - public void binaryField(FieldInfo fieldInfo, byte[] value, int offset, int length) throws IOException { + /** Process a binary field. + * @param value newly allocated byte array with the binary contents. + */ + public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { } /** Process a string field */ Index: lucene/core/src/java/org/apache/lucene/document/DocumentStoredFieldVisitor.java =================================================================== --- lucene/core/src/java/org/apache/lucene/document/DocumentStoredFieldVisitor.java (revision 1390018) +++ lucene/core/src/java/org/apache/lucene/document/DocumentStoredFieldVisitor.java (working copy) @@ -58,8 +58,8 @@ } @Override - public void binaryField(FieldInfo fieldInfo, byte[] value, int offset, int length) throws IOException { - doc.add(new StoredField(fieldInfo.name, value, offset, length)); + public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { + doc.add(new StoredField(fieldInfo.name, value)); } @Override Index: lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java =================================================================== --- lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java (revision 1390018) +++ lucene/codecs/src/java/org/apache/lucene/codecs/simpletext/SimpleTextStoredFieldsReader.java (working copy) @@ -139,10 +139,9 @@ if (type == TYPE_STRING) { visitor.stringField(fieldInfo, new String(scratch.bytes, scratch.offset+VALUE.length, scratch.length-VALUE.length, "UTF-8")); } else if (type == TYPE_BINARY) { - // TODO: who owns the bytes? byte[] copy = new byte[scratch.length-VALUE.length]; System.arraycopy(scratch.bytes, scratch.offset+VALUE.length, copy, 0, copy.length); - visitor.binaryField(fieldInfo, copy, 0, copy.length); + visitor.binaryField(fieldInfo, copy); } else if (type == TYPE_INT) { UnicodeUtil.UTF8toUTF16(scratch.bytes, scratch.offset+VALUE.length, scratch.length-VALUE.length, scratchUTF16); visitor.intField(fieldInfo, Integer.parseInt(scratchUTF16.toString())); Index: lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java =================================================================== --- lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java (revision 1390018) +++ lucene/test-framework/src/java/org/apache/lucene/index/FieldFilterAtomicReader.java (working copy) @@ -72,8 +72,8 @@ public void document(final int docID, final StoredFieldVisitor visitor) throws IOException { super.document(docID, new StoredFieldVisitor() { @Override - public void binaryField(FieldInfo fieldInfo, byte[] value, int offset, int length) throws IOException { - visitor.binaryField(fieldInfo, value, offset, length); + public void binaryField(FieldInfo fieldInfo, byte[] value) throws IOException { + visitor.binaryField(fieldInfo, value); } @Override