Skip to content

Commit

Permalink
Fix regression in lwM2mNodeDeserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Nov 18, 2015
1 parent 28cf9d1 commit aa87354
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ private org.eclipse.leshan.core.model.ResourceModel.Type getTypeFor(JsonPrimitiv
if (val.isString())
return org.eclipse.leshan.core.model.ResourceModel.Type.STRING;
if (val.isNumber()) {
if (val.getAsDouble() == (long) val.getAsLong()) {
return org.eclipse.leshan.core.model.ResourceModel.Type.BOOLEAN;
if (val.getAsDouble() == (double) val.getAsLong()) {
return org.eclipse.leshan.core.model.ResourceModel.Type.INTEGER;
} else {
return org.eclipse.leshan.core.model.ResourceModel.Type.BOOLEAN;
return org.eclipse.leshan.core.model.ResourceModel.Type.FLOAT;
}
}
// use string as default value
Expand Down

0 comments on commit aa87354

Please sign in to comment.