diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-01-06 16:12:22 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2020-01-06 16:12:22 +0100 |
commit | 26009aa6282ce91bf83d4432520f023d1b2f7a71 (patch) | |
tree | dc34478dbe7173656367b134c0301d4d975a6244 /vespaclient-container-plugin | |
parent | d6559242c1495ba9948d4723e15827614758acb9 (diff) |
Remove use of commons-lang from vespaclient-container-plugin
Diffstat (limited to 'vespaclient-container-plugin')
3 files changed, 11 insertions, 16 deletions
diff --git a/vespaclient-container-plugin/pom.xml b/vespaclient-container-plugin/pom.xml index 53e708601d7..9c4b81da806 100644 --- a/vespaclient-container-plugin/pom.xml +++ b/vespaclient-container-plugin/pom.xml @@ -62,11 +62,6 @@ </exclusions> </dependency> <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.4</version> - </dependency> - <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/LocalDataVisitorHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/LocalDataVisitorHandler.java index ae8413f226e..325c5492776 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/LocalDataVisitorHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/LocalDataVisitorHandler.java @@ -5,7 +5,7 @@ import com.yahoo.document.Document; import com.yahoo.document.DocumentId; import com.yahoo.document.json.JsonWriter; import com.yahoo.documentapi.DumpVisitorDataHandler; -import org.apache.commons.lang3.exception.ExceptionUtils; +import com.yahoo.exception.ExceptionUtils; import java.nio.charset.StandardCharsets; @@ -43,7 +43,7 @@ class LocalDataVisitorHandler extends DumpVisitorDataHandler { } } catch (Exception e) { synchronized (monitor) { - errors.append(ExceptionUtils.getStackTrace(e)).append("\n"); + errors.append(ExceptionUtils.getStackTraceAsString(e)).append("\n"); } } } @@ -62,7 +62,7 @@ class LocalDataVisitorHandler extends DumpVisitorDataHandler { } } catch (Exception e) { synchronized (monitor) { - errors.append(ExceptionUtils.getStackTrace(e)).append("\n"); + errors.append(ExceptionUtils.getStackTraceAsString(e)).append("\n"); } } } diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java index 94a38a9d3db..0485689b15d 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/OperationHandlerImpl.java @@ -21,13 +21,13 @@ import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol; import com.yahoo.documentapi.metrics.DocumentApiMetrics; import com.yahoo.documentapi.metrics.DocumentOperationStatus; import com.yahoo.documentapi.metrics.DocumentOperationType; +import com.yahoo.exception.ExceptionUtils; import com.yahoo.messagebus.StaticThrottlePolicy; import com.yahoo.metrics.simple.MetricReceiver; import com.yahoo.vespaclient.ClusterDef; import com.yahoo.vespaxmlparser.FeedOperation; import com.yahoo.yolean.concurrent.ConcurrentResourcePool; import com.yahoo.yolean.concurrent.ResourceFactory; -import org.apache.commons.lang3.exception.ExceptionUtils; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; @@ -146,7 +146,7 @@ public class OperationHandlerImpl implements OperationHandler { } catch (Exception e) { throw new RestApiException(Response.createErrorResponse( 500, - "Failed during parsing of arguments for visiting: " + ExceptionUtils.getStackTrace(e), + "Failed during parsing of arguments for visiting: " + ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.VISITOR_ERROR)); } @@ -175,7 +175,7 @@ public class OperationHandlerImpl implements OperationHandler { visitorControlHandler.waitUntilDone(); // VisitorParameters' session timeout implicitly triggers timeout failures. throwIfFatalVisitingError(visitorControlHandler, restUri); } catch (InterruptedException e) { - throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.INTERRUPTED)); + throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.INTERRUPTED)); } if (localDataVisitorHandler.getErrors().isEmpty()) { Optional<String> continuationToken; @@ -214,7 +214,7 @@ public class OperationHandlerImpl implements OperationHandler { } catch (DocumentAccessException documentException) { response = createErrorResponse(documentException, restUri); } catch (Exception e) { - response = Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.INTERNAL_EXCEPTION); + response = Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.INTERNAL_EXCEPTION); } finally { syncSessions.free(syncSession); } @@ -236,7 +236,7 @@ public class OperationHandlerImpl implements OperationHandler { } catch (DocumentAccessException documentException) { response = createErrorResponse(documentException, restUri); } catch (Exception e) { - response = Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.INTERNAL_EXCEPTION); + response = Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.INTERNAL_EXCEPTION); } finally { syncSessions.free(syncSession); } @@ -268,7 +268,7 @@ public class OperationHandlerImpl implements OperationHandler { response = Response.createErrorResponse(400, documentException.getMessage(), restUri, RestUri.apiErrorCodes.DOCUMENT_EXCEPTION); } } catch (Exception e) { - response = Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED); + response = Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED); } finally { syncSessions.free(syncSession); } @@ -297,7 +297,7 @@ public class OperationHandlerImpl implements OperationHandler { return Optional.of(outputStream.toString(StandardCharsets.UTF_8.name())); } catch (Exception e) { - throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED)); + throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED)); } finally { syncSessions.free(syncSession); } @@ -441,7 +441,7 @@ public class OperationHandlerImpl implements OperationHandler { try { params.setResumeToken(ProgressToken.fromSerializedString(options.continuation.get())); } catch (Exception e) { - throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTrace(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED)); + throw new RestApiException(Response.createErrorResponse(500, ExceptionUtils.getStackTraceAsString(e), restUri, RestUri.apiErrorCodes.UNSPECIFIED)); } } return params; |