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

commit 1bf5c436e8b1eb3e5f4b0b0bc3d504b9f45a5045
Author: Andrea Cosentino <[email protected]>
AuthorDate: Fri Oct 30 08:16:13 2020 +0100

    CAMEL-15770 - Removed refs to serializerClass through a little refactoring
---
 .../java/org/apache/camel/component/kafka/KafkaProducer.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 153e225..14b2671 100644
--- 
a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ 
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -386,22 +386,22 @@ public class KafkaProducer extends DefaultAsyncProducer {
     }
 
     /**
-     * Attempts to convert the object to the same type as the serialized class 
specified
+     * Attempts to convert the object to the same type as the value serializer 
specified
      */
-    protected Object tryConvertToSerializedType(Exchange exchange, Object 
object, String serializerClass) {
+    protected Object tryConvertToSerializedType(Exchange exchange, Object 
object, String valueSerializer) {
         Object answer = null;
 
         if (exchange == null) {
             return object;
         }
 
-        if (KafkaConstants.KAFKA_DEFAULT_SERIALIZER.equals(serializerClass)) {
+        if (KafkaConstants.KAFKA_DEFAULT_SERIALIZER.equals(valueSerializer)) {
             answer = 
exchange.getContext().getTypeConverter().tryConvertTo(String.class, exchange, 
object);
-        } else if 
("org.apache.kafka.common.serialization.ByteArraySerializer".equals(serializerClass))
 {
+        } else if 
("org.apache.kafka.common.serialization.ByteArraySerializer".equals(valueSerializer))
 {
             answer = 
exchange.getContext().getTypeConverter().tryConvertTo(byte[].class, exchange, 
object);
-        } else if 
("org.apache.kafka.common.serialization.ByteBufferSerializer".equals(serializerClass))
 {
+        } else if 
("org.apache.kafka.common.serialization.ByteBufferSerializer".equals(valueSerializer))
 {
             answer = 
exchange.getContext().getTypeConverter().tryConvertTo(ByteBuffer.class, 
exchange, object);
-        } else if 
("org.apache.kafka.common.serialization.BytesSerializer".equals(serializerClass))
 {
+        } else if 
("org.apache.kafka.common.serialization.BytesSerializer".equals(valueSerializer))
 {
             // we need to convert to byte array first
             byte[] array = 
exchange.getContext().getTypeConverter().tryConvertTo(byte[].class, exchange, 
object);
             if (array != null) {

Reply via email to