Skip to content
This repository has been archived by the owner on Jan 22, 2019. It is now read-only.

Can not serialize guava Iterables #46

Closed
cowtowncoder opened this issue Aug 8, 2014 · 6 comments
Closed

Can not serialize guava Iterables #46

cowtowncoder opened this issue Aug 8, 2014 · 6 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(moved from FasterXML/jackson-databind#517 reported by @chisui)


In 2.4.1.3 this works

new ObjectMapper().writeValueAsString(new Iterable<Integer>() {
  @Override
  public Iterator<Integer> iterator() {
    return ImmutableList.of(1, 2, 3).iterator();
  }
});

but this doesn't.

new ObjectMapper().writeValueAsString(Iterables.limit(Iterables.cycle(1,2,3), 3));
@cowtowncoder
Copy link
Member Author

As per commit, will also be in 2.3.5, should that be released.

@prb
Copy link
Member

prb commented Dec 30, 2014

I'm still getting this on 2.4.4. Potentially mitigating circumstances:

  • The Iterable<String> in question is a public member on a class that is serialized.
  • The class is annotated with @JsonInclude(JsonInclude.Include.NON_NULL).

@prb
Copy link
Member

prb commented Dec 30, 2014

Also, Guava version 17.

@prb
Copy link
Member

prb commented Dec 30, 2014

This appears to be resolved with 2.5.0-rc1, FWIW.

@christophercurrie
Copy link
Member

Specifically, I think #58 fixed this.

@christophercurrie
Copy link
Member

I think 2.4.5-SNAPSHOT has the fix, as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants