File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/main/java/com/ibm/eventstreams/connect/mqsource/processor Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 9494 <configuration >
9595 <source >1.8</source >
9696 <target >1.8</target >
97+ <compilerArgument >-Xlint:unchecked</compilerArgument >
9798 </configuration >
9899 </plugin >
99100 <plugin >
Original file line number Diff line number Diff line change 2323import javax .jms .Message ;
2424import java .util .ArrayList ;
2525import java .util .Collections ;
26+ import java .util .Enumeration ;
27+ import java .util .List ;
2628
2729/*
2830 * Single responsibility class to copy JMS properties to Kafka headers.
@@ -44,9 +46,13 @@ public ConnectHeaders convertJmsPropertiesToKafkaHeaders(Message message) {
4446
4547 ConnectHeaders connectHeaders = new ConnectHeaders ();
4648
47- ArrayList jmsPropertyKeys = null ;
49+
4850 try {
49- jmsPropertyKeys = Collections .list (message .getPropertyNames ());
51+ @ SuppressWarnings ("unchecked" )
52+ //com.ibm.msg.client.jms.internal.JmsMessageImpl.getPropertyNames returns Enumeration<String>
53+ Enumeration <String > propertyNames = (Enumeration <String >)message .getPropertyNames ();
54+ List <String > jmsPropertyKeys = Collections .list (propertyNames );
55+
5056 jmsPropertyKeys .forEach (key -> {
5157 try {
5258 connectHeaders .addString (key .toString (), message .getObjectProperty (key .toString ()).toString ());
You can’t perform that action at this time.
0 commit comments