Skip to content

Commit

Permalink
using valueOf instead of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
mox601 committed Mar 13, 2014
1 parent b28c424 commit f4f4250
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Value serialize(Integer object) throws TypeHandlerException {

public Integer deserialize(Value resource) throws TypeHandlerException {
try {
return new Integer(resource.stringValue());
return Integer.valueOf(resource.stringValue());
} catch(NumberFormatException e) {
throw new TypeHandlerException("The value: '"
+ resource.stringValue() + "' cannot be represented with an integer");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Value serialize(Long object) throws TypeHandlerException {

public Long deserialize(Value resource) throws TypeHandlerException {
try {
return new Long(resource.stringValue());
return Long.valueOf(resource.stringValue());
} catch(NumberFormatException e) {
throw new TypeHandlerException("The value: '"
+ resource.stringValue() + "' cannot be represented with a long");
Expand Down

0 comments on commit f4f4250

Please sign in to comment.