Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

Fix for PacketParserUtils not handling byte and short types

$
0
0

I had use of these types, and found that PacketParserUtils did not handle them along with the other primitive data types.

 

This fix applies to org.jivesoftware.smack.util.PacketParserUtils.

 

It's a simple addition to the decode function:

 

@@ -896,6 +896,12 @@

         if (type.getName().equals("double")) {

             return Double.valueOf(value);

         }

+        if (type.getName().equals("short")) {

+            return Short.valueOf(value);

+        }

+        if (type.getName().equals("byte")) {

+            return Byte.valueOf(value);

+        }

         if (type.getName().equals("java.lang.Class")) {

             return Class.forName(value);

         }


Viewing all articles
Browse latest Browse all 10742

Trending Articles