Menu

#429 Document that need to implement hashCode/equals for customLookupCondition

2.3.23
closed-fixed
nobody
None
5
2015-07-05
2015-05-06
No

From the latest release:
"Added new Configuration.getTemplate(...) parameter, Object customLookupCondition."

This was awesome, and we used it to choose a mobile version of a template if one is available, but I forgot to implement hashcode/equals on my my custom lookup obj, which caused the template cache to think every template key was unique and we rapidly ran out of memory :)

Probably worth calling out in the documentation that you need to remember hashcode/equals. Thanks!

Discussion

  • Dániel Dékány

    As a matter of fact, the JavaDoc of customLookupCondition says: "This object will be used as part of the cache key, so it must to have a proper {@link Object#equals(Object)} and {@link Object#hashCode()} method. It also should have reasonable {@link Object#toString()}, as it's possibly quoted in error message". But I have added notices on more places now.

     
  • Dániel Dékány

    • status: open --> open-fixed
    • Group: undecided --> 2.3.23
     
  • Jasper Rosenberg

    Weird, I searched the Javadoc before posting this, I must have just missed it. Thanks!

     
  • Jasper Rosenberg

    (also glad you reposted that here because I hadn't added toString())

     
  • Dániel Dékány

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.