From 51de15dcf157657305fa412648d2557f02447bc9 Mon Sep 17 00:00:00 2001 From: Colin Goodheart-Smithe Date: Tue, 18 Apr 2017 12:50:05 +0100 Subject: [PATCH] Fixes compile errors in Eclipse due to generics PersistentTasksCustomMetadata was using a generic param named `Params`. This conflicted with the imported interface `ToXContent.Params`. The java compiler was preferring the generic param over the interface so everything was fine but Eclipse apparently prefers the interface int his case which was screwing up the Hierarchy and causing compile errors in Eclipse. This changes fixes it by renaming the Generic param to `P` Original commit: elastic/x-pack-elasticsearch@8528870684c4ab944883eccd29813f66d7315706 --- .../PersistentTasksCustomMetaData.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin/src/main/java/org/elasticsearch/xpack/persistent/PersistentTasksCustomMetaData.java b/plugin/src/main/java/org/elasticsearch/xpack/persistent/PersistentTasksCustomMetaData.java index c42160d24fd..70a4855a17f 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/persistent/PersistentTasksCustomMetaData.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/persistent/PersistentTasksCustomMetaData.java @@ -253,12 +253,12 @@ public final class PersistentTasksCustomMetaData extends AbstractNamedDiffable implements Writeable, ToXContent { + public static class PersistentTask

implements Writeable, ToXContent { private final String id; private final long allocationId; private final String taskName; @Nullable - private final Params params; + private final P params; @Nullable private final Status status; private final Assignment assignment; @@ -266,21 +266,21 @@ public final class PersistentTasksCustomMetaData extends AbstractNamedDiffable task, long allocationId, Assignment assignment) { + public PersistentTask(PersistentTask

task, long allocationId, Assignment assignment) { this(task.id, allocationId, task.taskName, task.params, task.status, assignment, task.allocationId); } - public PersistentTask(PersistentTask task, Status status) { + public PersistentTask(PersistentTask

task, Status status) { this(task.id, task.allocationId, task.taskName, task.params, status, task.assignment, task.allocationId); } - private PersistentTask(String id, long allocationId, String taskName, Params params, + private PersistentTask(String id, long allocationId, String taskName, P params, Status status, Assignment assignment, Long allocationIdOnLastStatusUpdate) { this.id = id; this.allocationId = allocationId; @@ -308,7 +308,7 @@ public final class PersistentTasksCustomMetaData extends AbstractNamedDiffable