aboutsummaryrefslogtreecommitdiff
path: root/src/org/gnunet/construct/ReflectUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/gnunet/construct/ReflectUtil.java')
-rw-r--r--src/org/gnunet/construct/ReflectUtil.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/gnunet/construct/ReflectUtil.java b/src/org/gnunet/construct/ReflectUtil.java
index 0bc50bc..532f4fa 100644
--- a/src/org/gnunet/construct/ReflectUtil.java
+++ b/src/org/gnunet/construct/ReflectUtil.java
@@ -58,11 +58,11 @@ public class ReflectUtil {
58 } else if (t.equals(Integer.TYPE)) { 58 } else if (t.equals(Integer.TYPE)) {
59 Array.setInt(arr, i, (int) v); 59 Array.setInt(arr, i, (int) v);
60 } else if (t.equals(Short.TYPE)) { 60 } else if (t.equals(Short.TYPE)) {
61 Array.setInt(arr, i, (short) v); 61 Array.setShort(arr, i, (short) v);
62 } else if (t.equals(Byte.TYPE)) { 62 } else if (t.equals(Byte.TYPE)) {
63 Array.setInt(arr, i, (byte) v); 63 Array.setByte(arr, i, (byte) v);
64 } else if (t.equals(Character.TYPE)) { 64 } else if (t.equals(Character.TYPE)) {
65 Array.setInt(arr, i, (char) v); 65 Array.setChar(arr, i, (char) v);
66 } 66 }
67 } 67 }
68 68
@@ -71,8 +71,7 @@ public class ReflectUtil {
71 } 71 }
72 72
73 /** 73 /**
74 * assign an enum value to each numeric type we want to serialize in 74 * An enumeration of all built-in type that can store integers.
75 * order do switch statements on field types
76 */ 75 */
77 public enum NumFieldType { 76 public enum NumFieldType {
78 BIGNUM, BYTE_PRIM, SHORT_PRIM, INT_PRIM, LONG_PRIM, CHAR_PRIM 77 BIGNUM, BYTE_PRIM, SHORT_PRIM, INT_PRIM, LONG_PRIM, CHAR_PRIM
@@ -252,6 +251,7 @@ public class ReflectUtil {
252 for (int i = 0; i < path.size() - 1; ++i) { 251 for (int i = 0; i < path.size() - 1; ++i) {
253 try { 252 try {
254 obj = path.get(i).get(obj); 253 obj = path.get(i).get(obj);
254
255 } catch (IllegalArgumentException e) { 255 } catch (IllegalArgumentException e) {
256 throw new RuntimeException(e); 256 throw new RuntimeException(e);
257 } catch (IllegalAccessException e) { 257 } catch (IllegalAccessException e) {