You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gora.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2014/10/19 19:59:33 UTC
[jira] [Commented] (GORA-389) MongoStore: Document or List mapping
change cause NPE in clearDirty()
[ https://issues.apache.org/jira/browse/GORA-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14176368#comment-14176368 ]
ASF GitHub Bot commented on GORA-389:
-------------------------------------
GitHub user drazzib opened a pull request:
https://github.com/apache/gora/pull/15
GORA-389: Document or List mapping change cause NPE in clearDirty()
Fix for GORA-389
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Dictanova/gora GORA-389
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/gora/pull/15.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15
----
commit d7a6a4794f2fef492f1e116e1108b59d8e9c81bb
Author: Damien Raude-Morvan <da...@dictanova.com>
Date: 2014-10-08T18:04:06Z
Return empty DirtyListWrapper or DirtyMapWrapper instead of null.
commit 75805e2eaf3c1c69573dc1b2b2df12a25aec8d25
Author: Damien Raude-Morvan <da...@dictanova.com>
Date: 2014-10-08T18:03:36Z
Don't perform clearDirty() multiple times.
----
> MongoStore: Document or List mapping change cause NPE in clearDirty()
> ---------------------------------------------------------------------
>
> Key: GORA-389
> URL: https://issues.apache.org/jira/browse/GORA-389
> Project: Apache Gora
> Issue Type: Bug
> Components: gora-mongodb
> Affects Versions: 0.5
> Reporter: Damien Raude-Morvan
>
> I've found an issue in current implementation of MongoStore on [Document or List|http://gora.apache.org/current/gora-mongodb.html] mapping type handling.
> If your schema contains a field like this :
> {noformat}
> { "name": "keywords",
> "type": { "type": "array", "items": "string"},
> "default": null
> }
> {noformat}
> If you choose to latter defaults to an empty array instead of null value like this
> {noformat}
> { "name": "keywords",
> "type": { "type": "array", "items": "string"},
> "default": []
> }
> {noformat}
> loading old data will fail because of clearDirty method will try to also clear a null object.
> {code}
> persistent.clearDirty();
> {code}
> I implemented and tested a fix which always return a DirtyListWrapper or DirtyMapWrapper instead of previous null value.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)