Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.0.1
-
None
-
Security Level: Public
Description
If you save a long value, then read it back, you can get a ClassCastException. For instance, in this code, I save a long 0. Then read it back as a long. Couchbase returns it as an Integer:
Cluster cluster = CouchbaseCluster.create();
Bucket bucket = cluster.openBucket("test");
JsonObject jsonObject = JsonObject.empty().
put("value", 0L);
bucket.insert(JsonDocument.create("idTest", jsonObject));
JsonDocument value = bucket.get("idTest");
Long l = value.content().getLong("value");
System.out.println(l);