mysema/querydsl — Issue #81: MongodbSerializer unnecessarily calls getKeyForPath(…)
Author: olivergierke
Created: 2012-01-12 10:59:11+00:00
State: open

As stated in a [Spring Data forum post|http://forum.springsource.org/showthread.php?120452-NPE-in-QueryDslMongoRepository-after-M4-RC1-upgrade] `MongodbSerializer` recursively calls `visit(…)` for `any()` path types passing an empty expression to the call. This results in `getKeyForPath(…)` being called with an empty expression which is actually not necessary as looking up a key for no expression hardly makes sense. Beyond that, potential subclasses have to deal with that case explicitly which complicates the implementation.

Long story short, the call to `getKeyForPath(…)` can be delayed into the `else` clause, avoiding that obsolete call.