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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5
    • Fix Version/s: 0.6
    • Component/s: gora-mongodb
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: