• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Won't Fix
  • ehcache-core
  • drb
  • Reporter: amiller
  • April 05, 2010
  • 0
  • Watchers: 1
  • July 27, 2012
  • April 13, 2010


I tried to use the fluent api on CacheConfiguration and I accidentally did:

new Cache(new CacheConfiguration(“foo”, 100).setEternal(true)))

However, setEternal() doesn’t return “this” so can’t be chained. It would be nice if the set methods did return “this” so they could be chained OR if the javadoc for setEternal() referred you to eternal() which you are less likely to immediately notice.

The following code does work fine as intended:

new Cache(new CacheConfiguration(“foo”, 100).eternal(true)))


Geert Bevin 2010-04-13

This isn’t possible since it breaks the javabeans spec and those methods aren’t detected as setters anymore, they sadly absolutely need to return void.