-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JCBC-1574 JsonObject/Array.put(String,Object) fails on Map or List
Backported from SDK 3 commit fb2d3845d53ce202b91ad1f886fb7c701ea1ff4a Motivation ---------- There already exist specialized methods for putting Map and List values, but they are not invoked if the exact type of the value is not known at compile time. Support passing a Map or List to JsonObject/Array.put(String,Object). This is important since these methods are used by Spring Data Couchbase. Modifications ------------- Add a JsonValue.coerce(Object) method that converts the given object to a type that can be put in a JsonArray or JsonObject. Use this method everywhere a value of unknown type is added. For consistency, convert any ClassCastExceptions to InvalidArgumentExceptions. Change-Id: Iea39648a94743c9a05020ed7e5a78ee37ae2b589 Reviewed-on: http://review.couchbase.org/120924 Tested-by: David Nault <[email protected]> Reviewed-by: Michael Nitschinger <[email protected]>
- Loading branch information
Showing
5 changed files
with
108 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.