From 800b7f39bdfd373e669ef36d2ce334deab4dc36a Mon Sep 17 00:00:00 2001 From: kimchy Date: Thu, 23 Dec 2010 07:45:04 +0200 Subject: [PATCH] add toString to CompressedString to show when logging it --- .../elasticsearch/common/compress/CompressedString.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/CompressedString.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/CompressedString.java index 35f502f3934..35b48d4adfe 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/CompressedString.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/compress/CompressedString.java @@ -87,4 +87,12 @@ public class CompressedString implements Streamable { @Override public int hashCode() { return bytes != null ? Arrays.hashCode(bytes) : 0; } + + @Override public String toString() { + try { + return string(); + } catch (IOException e) { + return "_na_"; + } + } }