Use the help of BigInteger to parse strings representing
large unsigned hex long values.
diff --git a/src/main/java/net/floodlightcontroller/util/FlowEntryId.java b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
index d322f5e..e146a3d 100644
--- a/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
+++ b/src/main/java/net/floodlightcontroller/util/FlowEntryId.java
@@ -1,5 +1,7 @@
package net.floodlightcontroller.util;
+import java.math.BigInteger;
+
import net.floodlightcontroller.util.serializers.FlowEntryIdDeserializer;
import net.floodlightcontroller.util.serializers.FlowEntryIdSerializer;
@@ -37,7 +39,17 @@
* @param value the value to use.
*/
public FlowEntryId(String value) {
- this.value = Long.decode(value);
+ //
+ // Use the help of BigInteger to parse strings representing
+ // large unsigned hex long values.
+ //
+ char c = 0;
+ if (value.length() > 2)
+ c = value.charAt(1);
+ if ((c == 'x') || (c == 'X'))
+ this.value = new BigInteger(value.substring(2), 16).longValue();
+ else
+ this.value = Long.decode(value);
}
/**
diff --git a/src/main/java/net/floodlightcontroller/util/FlowId.java b/src/main/java/net/floodlightcontroller/util/FlowId.java
index 297c0c4..0297e2a 100644
--- a/src/main/java/net/floodlightcontroller/util/FlowId.java
+++ b/src/main/java/net/floodlightcontroller/util/FlowId.java
@@ -1,5 +1,7 @@
package net.floodlightcontroller.util;
+import java.math.BigInteger;
+
import net.floodlightcontroller.util.serializers.FlowIdDeserializer;
import net.floodlightcontroller.util.serializers.FlowIdSerializer;
@@ -37,7 +39,17 @@
* @param value the value to use.
*/
public FlowId(String value) {
- this.value = Long.decode(value);
+ //
+ // Use the help of BigInteger to parse strings representing
+ // large unsigned hex long values.
+ //
+ char c = 0;
+ if (value.length() > 2)
+ c = value.charAt(1);
+ if ((c == 'x') || (c == 'X'))
+ this.value = new BigInteger(value.substring(2), 16).longValue();
+ else
+ this.value = Long.decode(value);
}
/**