浏览代码

Added some additional information to the bad constants exception.
Only of marginal utility but it was a nice sanity check.

Paul Speed 9 年之前
父节点
当前提交
ac5cc5312b

+ 3 - 2
jme3-networking/src/main/java/com/jme3/network/serializing/serializers/EnumSerializer.java

@@ -48,8 +48,9 @@ public class EnumSerializer extends Serializer {
 
             if (ordinal == -1) return null;
             T[] enumConstants = c.getEnumConstants();
-            if (enumConstants == null)
-                throw new SerializerException( "Class has no enum constants:" + c );
+            if (enumConstants == null) {
+                throw new SerializerException("Class has no enum constants:" + c + "  Ordinal:" + ordinal);
+            }
             return enumConstants[ordinal];
         } catch (IndexOutOfBoundsException ex) {
             return null;