Added some additional information to the bad constants exception.

Only of marginal utility but it was a nice sanity check.
experimental
Paul Speed 9 years ago
parent a0569b340d
commit ac5cc5312b
  1. 5
      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; if (ordinal == -1) return null;
T[] enumConstants = c.getEnumConstants(); T[] enumConstants = c.getEnumConstants();
if (enumConstants == null) if (enumConstants == null) {
throw new SerializerException( "Class has no enum constants:" + c ); throw new SerializerException("Class has no enum constants:" + c + " Ordinal:" + ordinal);
}
return enumConstants[ordinal]; return enumConstants[ordinal];
} catch (IndexOutOfBoundsException ex) { } catch (IndexOutOfBoundsException ex) {
return null; return null;

Loading…
Cancel
Save