Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2600

Pojo class can't implement Iterable

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 3.5.0
    • Codecs
    • None
    • Debian Linux & Windows

    Description

      I was experimenting a bit with the POJO support added in 3.5. Just using the automatic PojoCodecProvider. But I noticed a weird behavior.

      When your POJO class implements Iterable. The BSON conversion generates an array type instead document type. I think this is a bug,

      You can reproduce it by using the PojoQuickTour example, Just make the Person implements Iterable<Address>, and implement the iterator<Address> and suddenly the code start failing/

      Attachments

        Activity

          People

            Unassigned Unassigned
            dekker_p Patrick Dekker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: