From fca6a2f006afd2cf7eda7ff89b0b678ad6722a7b Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Mon, 4 Mar 2019 11:37:59 +0100 Subject: [PATCH] Avoid deprecated API usage in TaskOperationFailure (#39303) (#39628) With this commit we remove usage of the deprecated method `ExceptionsHelper#detailedMessage` in the class `TaskOperationFailure`. Relates #19069 --- .../org/elasticsearch/action/TaskOperationFailure.java | 7 +------ .../elasticsearch/action/TaskOperationFailureTests.java | 3 --- .../cluster/node/tasks/TransportTasksActionTests.java | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java b/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java index 8740c446b06..0dac5cd7eca 100644 --- a/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java +++ b/server/src/main/java/org/elasticsearch/action/TaskOperationFailure.java @@ -33,7 +33,6 @@ import org.elasticsearch.rest.RestStatus; import java.io.IOException; -import static org.elasticsearch.ExceptionsHelper.detailedMessage; import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; /** @@ -102,10 +101,6 @@ public final class TaskOperationFailure implements Writeable, ToXContentFragment return this.taskId; } - public String getReason() { - return detailedMessage(reason); - } - public RestStatus getStatus() { return status; } @@ -116,7 +111,7 @@ public final class TaskOperationFailure implements Writeable, ToXContentFragment @Override public String toString() { - return "[" + nodeId + "][" + taskId + "] failed, reason [" + getReason() + "]"; + return "[" + nodeId + "][" + taskId + "] failed, reason [" + reason + "]"; } public static TaskOperationFailure fromXContent(XContentParser parser) { diff --git a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java b/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java index 442cb55def5..526cf672d34 100644 --- a/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java +++ b/server/src/test/java/org/elasticsearch/action/TaskOperationFailureTests.java @@ -46,9 +46,6 @@ public class TaskOperationFailureTests extends AbstractXContentTestCase