Skip to content
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

keep bundle annotations and prevent simple cycles #521

Merged
merged 2 commits into from Aug 25, 2014

Conversation

tea-dragon
Copy link
Contributor

I don't see any downsides and this makes it easier to manipulate
custom annotations, introspectors, serializers, and other parts
that interact with annotated objects. The cycle detection is a
bonus.

I don't see any downsides and this makes it easier to manipulate
custom annotations, introspectors, serializers, and other parts
that interact with annotated objects. The cycle detection is a
bonus.
@cowtowncoder
Copy link
Member

Was this related to problems with multiple annotation bundles?

@tea-dragon
Copy link
Contributor Author

In the sense that the "endless recursion" case it solves requires multiple annotation bundles, yes. The primary goal is to be able to use properties or implicit information from the annotation bundle itself.

@tea-dragon
Copy link
Contributor Author

Please note the 'build failures' are unrelated issues present in master.

@cowtowncoder
Copy link
Member

@tea-dragon Right, build failure is due to an unsolved problem, I need to move it under 'failing' (or fix if possible of course).

I hadn't thought about possiblity of cycles, as annotation datatypes can not have recursive notation.
But ability to attach meta-annotations does open up the door so that makes sense.

But I still don't understand the "be able to use properties or implicit information from the annotation bundle itself." part.

@tea-dragon
Copy link
Contributor Author

There is an example in the added tests. The InformativeHolder interface has a commented property that demonstrates it.

As another example, imagine I have a custom annotation @Bytes that affects deserialization in some way. I might want to have @Bytes imply @JsonProperty to reduce annotation clutter, but if I make @Bytes an annotation bundle, then currently I won't be able to see it from the modification hooks.

@cowtowncoder
Copy link
Member

@tea-dragon Ok thanks I will look at the test.

But on second part: which modification hooks are you referring to? Annotations from bundles should be visible from all access points, via AnnotatedXxx types.

@cowtowncoder
Copy link
Member

Oh, I see. So, that the annotation "wrapper" itself should not be dropped, but included, not just annotations it contains. Yes, that makes sense.
And similarly about recursive annotations; this is something I hadn't thought of given that all the other types for annotations must be non-recursive.

So I finally understand all pertinent points here I think. Thank you for explanation.

cowtowncoder added a commit that referenced this pull request Aug 25, 2014
keep bundle annotations and prevent simple cycles
@cowtowncoder cowtowncoder merged commit e585a8f into FasterXML:master Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants