mboudreau / Alternator

A mock DynamoDB that runs locally for testing purposes - DEPRECATED, PLEASE USE DYNAMODB LOCAL: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
Apache License 2.0
78 stars 39 forks source link

Attributes comparison in AlternatorDBHandler doesn't work #72

Open yelis913 opened 11 years ago

yelis913 commented 11 years ago

AlternatorDBHandler.java:424

(value.getValue().getN() != null && !item.get(key).equals(value.getValue().getN())) || (value.getValue().getS() != null && !item.get(key).equals(value.getValue().getS())) || (value.getValue().getNS() != null && !item.get(key).equals(value.getValue().getNS())) || (value.getValue().getSS() != null && !item.get(key).equals(value.getValue().getSS()))

There seems to be a wrong pattern here, because item.get(key) produces an AttributeValue which is then compared to an unwrapped value (e.g. String), so equals() always fails.

mboudreau commented 11 years ago

Fixed in commit https://github.com/yelis913/Alternator/commit/c82daad67d1d08b886666881d025d06720ecc046

Will be in 0.6.4 release.

Cheers.