From a98a6c36f808932d250fca96ad3c579fc13c138c Mon Sep 17 00:00:00 2001 From: Noble Paul Date: Thu, 18 Aug 2016 16:17:53 +0530 Subject: [PATCH] SOLR-8995: reverting the previous change due to compile error --- .../apache/solr/update/TransactionLog.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/update/TransactionLog.java b/solr/core/src/java/org/apache/solr/update/TransactionLog.java index 860717f8c30..f7213edbb78 100644 --- a/solr/core/src/java/org/apache/solr/update/TransactionLog.java +++ b/solr/core/src/java/org/apache/solr/update/TransactionLog.java @@ -87,15 +87,18 @@ public class TransactionLog implements Closeable { int snapshot_numRecords; // write a BytesRef as a byte array - JavaBinCodec.ObjectResolver resolver = (o, codec) -> { - if (o instanceof BytesRef) { - BytesRef br = (BytesRef)o; - codec.writeByteArray(br.bytes, br.offset, br.length); - return null; + static final JavaBinCodec.ObjectResolver resolver = new JavaBinCodec.ObjectResolver() { + @Override + public Object resolve(Object o, JavaBinCodec codec) throws IOException { + if (o instanceof BytesRef) { + BytesRef br = (BytesRef)o; + codec.writeByteArray(br.bytes, br.offset, br.length); + return null; + } + // Fallback: we have no idea how to serialize this. Be noisy to prevent insidious bugs + throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, + "TransactionLog doesn't know how to serialize " + o.getClass() + "; try implementing ObjectResolver?"); } - // Fallback: we have no idea how to serialize this. Be noisy to prevent insidious bugs - throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, - "TransactionLog doesn't know how to serialize " + o.getClass() + "; try implementing ObjectResolver?"); }; public class LogCodec extends JavaBinCodec {