Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-389

MongoStore: Document or List mapping change cause NPE in clearDirty()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.5
    • 0.6
    • gora-mongodb
    • None

    Description

      I've found an issue in current implementation of MongoStore on Document or List mapping type handling.

      If your schema contains a field like this :

      { "name": "keywords",
         "type": { "type": "array", "items": "string"},
         "default": null
      }
      

      If you choose to latter defaults to an empty array instead of null value like this

      { "name": "keywords",
         "type": { "type": "array", "items": "string"},
         "default": []
      }
      

      loading old data will fail because of clearDirty method will try to also clear a null object.

      persistent.clearDirty();
      

      I implemented and tested a fix which always return a DirtyListWrapper or DirtyMapWrapper instead of previous null value.

      Attachments

        Activity

          People

            drazzib Damien Raude-Morvan
            drazzib Damien Raude-Morvan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: