thmarx / vert.x-busmod-redis

Vert.x redis busmod - currently not under active development
Other
12 stars 7 forks source link

Ease long type check in ZRevRangeCommand #2

Closed reikje closed 12 years ago

reikje commented 12 years ago

The ZRevRangeCommand performs the following check.

checkType(start, "start must be of type long", new Class[] {Long.class});

If I use this code to send a JsonObject, it won't be considered a Long.

final JsonObject command = new JsonObject(); command.putString("command", "ZRevRange"); command.putString("key", "foo"); command.putNumber("start", 10L); command.putNumber("end", 90L);

eb.send("vertx.redis-client", command, ....)

but it works like this:

command.putNumber("start", Long.MAX_VALUE);

So somewhere along the way, the Number is "downsized". I think it would be possible to ease/remove the check because start.longValue() will always work because Long is the biggest number type in Java.

thmarx commented 12 years ago

removed