This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit b0588f310e9335ce13937c1bca295201979139fa Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Mon Jan 26 11:06:23 2026 +0000 (chores): modernize instanceof checks in camel-platform-http-vertx --- .../http/vertx/VertxPlatformHttpSupport.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java index c0683453834a..3c9eba48653b 100644 --- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java +++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java @@ -162,10 +162,10 @@ public final class VertxPlatformHttpSupport { } static Integer determineContentLength(Object body) { - if (body instanceof byte[]) { - return ((byte[]) body).length; - } else if (body instanceof ByteBuffer) { - return ((ByteBuffer) body).remaining(); + if (body instanceof byte[] byteArray) { + return byteArray.length; + } else if (body instanceof ByteBuffer bytebuffer) { + return bytebuffer.remaining(); } return null; } @@ -186,13 +186,13 @@ public final class VertxPlatformHttpSupport { LOGGER.trace("No payload to send as reply for exchange: {}", camelExchange); ctx.end(); promise.complete(); - } else if (body instanceof String) { - ctx.end((String) body); + } else if (body instanceof String string) { + ctx.end(string); promise.complete(); - } else if (body instanceof InputStream) { - writeResponseAs(promise, ctx, (InputStream) body); - } else if (body instanceof Buffer) { - ctx.end((Buffer) body); + } else if (body instanceof InputStream inputstream) { + writeResponseAs(promise, ctx, inputstream); + } else if (body instanceof Buffer buffer) { + ctx.end(buffer); promise.complete(); } else if (body instanceof ByteBuffer bb) { writeResponseAs(promise, ctx, bb);
