Closed kennymacleod closed 8 years ago
This actually isn't a bug, but rather a "temporary state". The plan is to get rid of all ehcache deps in the code, which include that exception. Eventually this condition will be checked by the walker itself and Ehcache will inject the behavior (i.e. throw the exception when we've walked more than the max configured). I understand this is currently a bit confusing. But one thing we could do is have the IllegalArgException being caught and wrapped within a MaxDepthExceededException within the EhcacheSizeOfEngine, as this can (and does) reference Ehcache types, as it will eventually disappear from here and be moved to Ehcache when that only uses this code (eventually).
If the "feature" is required now, it needs to be implemented using the VisitorListener (see #10)
When ObjectGraphWalker exceeds the max depth, it throws an IllegalArgumentException. However EhcacheSizeOfEngine is expecting to catch a MaxDepthExceededException. The IllegalArgumentException bubbles up past that catch and a stack trace is logged.
This is odd, given that the sizeof engine in EhCache 2.8 throws the correct MaxDepthExceededException.