From 9108001c73517bface191a5d17a89ad3eeb532f7 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Wed, 6 Jan 2016 13:26:31 +0100 Subject: [PATCH] Watcher: Remove pre 2.0 compatibility code This code is not needed anymore in any 2.x version. Original commit: elastic/x-pack-elasticsearch@8346b0120e9702d40d3557f572638f8daa2639f6 --- .../java/org/elasticsearch/watcher/watch/WatchStore.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/watch/WatchStore.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/watch/WatchStore.java index 65823037bbc..49a18916a4f 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/watch/WatchStore.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/watch/WatchStore.java @@ -205,12 +205,7 @@ public class WatchStore extends AbstractComponent { IndexRequest createIndexRequest(String id, BytesReference source, long version) { IndexRequest indexRequest = new IndexRequest(INDEX, DOC_TYPE, id); - // TODO (2.0 upgrade): move back to BytesReference instead of dealing with the array directly - if (source.hasArray()) { - indexRequest.source(source.array(), source.arrayOffset(), source.length()); - } else { - indexRequest.source(source.toBytes()); - } + indexRequest.source(source.toBytes()); indexRequest.version(version); return indexRequest; }