-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Problem handling datatypes Recursive type parameters #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Strange but true -- this does fail. I can simplify it for test. I will also see that Java-classmate project (https://github.com/cowtowncoder/java-classmate) handles this cleanly; one of these days I should make Jackson use classmate's resolution as it's superior to Jackson's own. |
(note to self: yup, as usual, ClassMate resolves this without incident) |
Ok, so recursion here is not resolved because it is not via type variables (V extends Type), but sort of direct dependency. Need to see how to break that cycle with existing Jackson type resolution code. |
ah ok, I'll check out java-classmate, cheers! |
One clarification: while java-classmate can handle this type, it unfortunately won't help too much with Jackson. One thing here that might help is to use intermediate type in hierarchy, to try to untangle the reference. I am still trying to figure out how to break the cycle: solution is not as easy to find as I hoped. |
Ah ok I see. I've gotten around the issue by having an internal private On 23 September 2012 03:15, Tatu Saloranta [email protected] wrote:
|
Ok good. I realized that TypeFactory obviously let's you build equivalent resolved type. |
Ok, thanks again for getting back to me so quickly! On 23 September 2012 14:05, Tatu Saloranta [email protected] wrote:
|
Looks like I might finally find a way to fix this -- when working on #728, noticed that one change fixed the failing test case here. Unfortunately it also broke 3 other tests, so need to dig bit deeper. |
Or not. Turns out that fix really is not correct, and while resolving fail on this case is not proper way to resolve it. |
Just wanted to say that I've been having this issue as well which is quite unfortunate as it requires a cyclic HashMap of generics and can't easily be rewritten. |
@PommeVerte I have not settled on ETA. The problem is that it is quite difficult to have an idea of how much work is needed, and what the compatibility issues would be, from retrofitting |
I see! Fingers crossed then. :) |
Phew. With a major rewrite of the whole type handling system, this bug has been annihilated for 2.7.0. |
Great news!! Looking forward to 2.7.0. Are you guys aiming for a specific release date on this? I think there's an upcoming 2.6.4 in the works already so it would obviously be for after that? |
@PommeVerte No, we don't have a good idea wrt release date at this point, but if I had to guess, official release would be likely in early January, if release candidates were started in December 2015. |
I'm wondering if this bug still exists in 2.8.0. I upgraded to 2.8.0 and I'm still getting a StackOverflowError. Here's the class I'm binding:
Here's a snippet of the stack trace I get:
EDIT: I did some debugging and found that this looks like the location where the stack track starts:
It's line 87 in WORK-AROUND: In case anyone looks at this issue and needs a work around, you can use the
I also think that this can likely be fixed with code like this:
|
@voidmain could you please file a separate new issue with information you included -- this sounds like a new problem, possibly related to added caching for generic types. |
I'm getting a stack overflow when trying to serialize this:
Is this a limitation of Jackson or am I doing something wrong?
http://stackoverflow.com/questions/12466292/serializing-a-recursive-class-with-jackson-json
Thanks!
The text was updated successfully, but these errors were encountered: