Skip to content

Commit

Permalink
BUG: double adapater converting number to long
Browse files Browse the repository at this point in the history
  • Loading branch information
rportela committed Jan 26, 2018
1 parent b0621e9 commit f5fa4c7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public DoubleAdapter() {
*/
@Override
public Double parse(String source) {
return source == null || source.isEmpty()
? whenNull()
: new Double(source);
return source == null || source.isEmpty() ?
whenNull() :
new Double(source);
}

/**
Expand All @@ -35,7 +35,7 @@ public Double parse(String source) {
@Override
protected Double changeType(Class<?> sourceClass, Object source) {
if (Number.class.isAssignableFrom(sourceClass))
return (double) ((Number) source).longValue();
return (double) ((Number) source).doubleValue();
else if (Date.class.isAssignableFrom(sourceClass))
return (double) ((Date) source).getTime();
else if (java.sql.Date.class.isAssignableFrom(sourceClass))
Expand Down

0 comments on commit f5fa4c7

Please sign in to comment.