camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] branch master updated: CAMEL-15309 - There the BufferCaster for this purpose, use it - camel-syslog
Date Fri, 17 Jul 2020 16:13:49 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 57d19e5  CAMEL-15309 - There the BufferCaster for this purpose, use it - camel-syslog
57d19e5 is described below

commit 57d19e51c3fdddc049ad5771f84984a732fcb65d
Author: Andrea Cosentino <ancosen@gmail.com>
AuthorDate: Fri Jul 17 18:12:07 2020 +0200

    CAMEL-15309 - There the BufferCaster for this purpose, use it - camel-syslog
---
 .../main/java/org/apache/camel/component/syslog/SyslogConverter.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/SyslogConverter.java
b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/SyslogConverter.java
index 85f3cab..b1e0a65 100644
--- a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/SyslogConverter.java
+++ b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/SyslogConverter.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.syslog;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.nio.Buffer;
 import java.nio.ByteBuffer;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
@@ -31,6 +30,8 @@ import org.apache.camel.Converter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.camel.util.BufferCaster.cast;
+
 @Converter(generateLoader = true)
 public final class SyslogConverter {
 
@@ -136,7 +137,7 @@ public final class SyslogConverter {
     public static SyslogMessage parseMessage(byte[] bytes) {
         ByteBuffer byteBuffer = ByteBuffer.allocate(bytes.length);
         byteBuffer.put(bytes);
-        ((Buffer) byteBuffer).rewind();
+        cast(byteBuffer).rewind();
 
         Character charFound = (char) byteBuffer.get();
 


Mime
View raw message