Skip to content

Use IterationType in TypeUtil #599

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

Merged

Conversation

JooHyukKim
Copy link
Member

Make use of new IterationType class added by FasterXML/jackson-databind#3950

@JooHyukKim JooHyukKim marked this pull request as ready for review May 24, 2023 14:22
@JooHyukKim
Copy link
Member Author

From what I understand, this solution works for Iterator support in Scala module, but if not LMK 👍🏻👍🏻

@cowtowncoder
Copy link
Member

From what I understand, this solution works for Iterator support in Scala module, but if not LMK 👍🏻👍🏻

It may be the case; for Collections, Maps, Scala has its alternatives, but maybe Iterator used as-is? @pjfanning would know.

I'll get this merged later today, looks good!

@pjfanning
Copy link
Member

there will need to be changes in jackson-module-scala to uptake IterationType and it could break existing cases - so I may need to come back and request changes

jackson-module-scala currently treats Scala Iterators as CollectionLikeType and changing that to IterationType will have effects that need to be dealt with

@pjfanning
Copy link
Member

pjfanning commented May 24, 2023

@cowtowncoder we don't see to have a findIterationSerializer to match findCollectionLikeSerializer - should we have a specialised method for IterationType?

@cowtowncoder cowtowncoder merged commit a9c14b1 into FasterXML:2.16 May 25, 2023
@cowtowncoder
Copy link
Member

cowtowncoder commented May 25, 2023

@pjfanning I have been wondering about that... whether it's worth it or not. Main concern would be backwards-compatibility wrt registrations (if calls that used to go for general methods now went to new method, existing code might fail).

But I guess default implementation could delegate to:

  • findBeanDeserializer() (in Serializers)
  • findSerializer() (in Deserializers)

Filed: FasterXML/jackson-databind#3954

@JooHyukKim JooHyukKim deleted the TypeUtil-to-use-iterationtype branch May 29, 2023 13:51
@AnakinPt
Copy link

I think this PR broke something. java.lang.String doesn't have the isIterationType(). I believe this should be reviewed.

I created the issue #622 with this failure

@cowtowncoder
Copy link
Member

@AnakinPt As per note on #622, the issue is that you are deploying an incompatible set of versions of components.

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.

4 participants