depth always reset
podam-5.3.1.RELEASE /uk/co/jemos/podam/api/PodamFactoryImpl.java:1839
Integer depth = pojos.get(realAttributeType);
if (depth == null) {
depth = -1;
}
if (depth <= strategy.getMaxDepth(pojo.getClass())) {
pojos.put(realAttributeType, depth + 1);, //<-- increment depth
attributeValue = this.manufacturePojoInternal(
realAttributeType, attributeMetadata, pojos, genericTypeArgsAll);
pojos.put(realAttributeType, depth);//<-- put -1 again
}
For example
class A {
List<B> childs;
}
class B{
A parentB;
}
will cause infinity loop Memorizing is not a option. Because list (childs) will be contain copy of same instance
Two things:
- Depth limits traversal depth on the POJO's attribute tree. There is nothing wrong with it.
- I've tried example and there is no stack overflow: https://travis-ci.org/daivanov/podam/builds/60575048
With 5.3.2-SNAPSHOT parent-children relation is correctly filled, when memoization enabled; https://travis-ci.org/daivanov/podam/builds/60601308
Could I close this issue or will you update it with additional information how to reproduce the problem and/or stack trace?
I think we can close this issue and if @bakomchik finds further issues he can log them here.
Ok. Please create new issue, if anything further will be discovered!