Permalink
Browse files

added numeric conversions instead of casting on typed getters

  • Loading branch information...
1 parent 8c1d7ab commit 8ec271d7b524b751c566a6fa08f03a59729a1338 @michelegonella committed Dec 6, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 zen-dataobject/src/main/java/com/nominanuda/dataobject/AbstractDataStruct.java
@@ -245,12 +245,12 @@ public DataArray getPathSafeArray(String path) throws ClassCastException {
public Long getLong(K key) throws ClassCastException {
Number n = getNumber(key);
- return n == null ? null : (Long)n;
+ return n == null ? null : n.longValue();
}
public Double getDouble(K key) throws ClassCastException {
Number n = getNumber(key);
- return n == null ? null : (Double)n;
+ return n == null ? null : n.doubleValue();
}
public String getStrictString(K key) throws ClassCastException,

0 comments on commit 8ec271d

Please sign in to comment.