-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Add StreamWriteConstraints with a nesting depth check #1055
Add StreamWriteConstraints with a nesting depth check #1055
Conversation
@cowtowncoder this code does not work yet because of a quirk in how JsonWriteContext works. The nestingDepth is tracked if you create a JsonWriteContext with a parent context (inside the null check below). But JsonWriteContext has the Is there any hope that this reset behaviour could be removed? So, we would instead create a new JsonWriteContext with a parent instead.
|
+1 for working on this. I will not have time to engage on this for next 2 weeks or so (will try to send an email notification about my vacation), except for today and tomorrow. |
@cowtowncoder I have the some tests working now and the issue I was hitting with JsonWriteContext was a bug in my code. If I remove the changes in the Filtering Delegate Generator (because they are overkill), would it be possible to get this merged today/tomorrow? That would make it easier for me to test out the changes in jackson-databind and other jackson modules. Whatever way it falls out, we can complete the extra bits after your vacation. |
Reset is NOT used for general purpose reuse but specifically case of avoiding allocation for a sibling of earlier nesting level. This is noted in Javadoc comments. I may be missing something here so want to make sure I understand the problem. |
I was debugging an issue and I misunderstood what was going on. The context reset was not the issue and it does not need to change. I have the PR working with a few basic tests now. |
@pjfanning Ok perfect. I just wanted to make sure you weren't blocked here. Plus role of |
@pjfanning Oh, one other thing -- I know it's a pain, but once you have something ready, is there any chance of merging things incrementally, to help merge to |
Update TokenFilterContext.java make stream write constraints accessible Update FilteringGeneratorDelegate.java police nesting depth in json generators Update JsonGeneratorImpl.java add test that should fail fix test test issue more tests revert changes in FilteringGeneratorDelegate Update FilteringGeneratorDelegate.java
19ae34f
to
04e6edf
Compare
@cowtowncoder I created #1056 for master. |
@cowtowncoder could you review this PR when you have time? There would be need of follow up PRs in jackson-databind and some of the other modules (XML, text formats, binary formats). I can do those after this is merged. |
@pjfanning Yes, trying to go through backlog now that I am back; will try to get this (and 1056) reviewed ASAP. |
Sorry, didn't get this done today; aiming for tomorrow. |
StreamWriteConstraints
) #1048