Comments (2)
Hi @oiale
Arrays.asList("A", "B")
returns a object of type Arrays$ArrayList```
Arrays.asList returns a List implementation, but it's not a java.util.ArrayList. It happens to have a classname of ArrayList, but that's a nested class within Arrays - a completely different type from java.util.ArrayList
Also JsonDB uses XMLEncoder internally to create a deep copy of objects before processing them. However Arrays$ArrayList does not serialise properly, thats probably because XMLEncoder requires it to be a valid JavaBean, meaning among other things it should have a default public constructor which Arrays does not have
So the way you are using it, its not going to work. To workaround this issue I suggest you create a proper java.util.List and then set it into the bean:
List<String> stuff = new ArrayList<String>(Arrays.asList("A", "B"));
bean.setStuff(stuff);
This should work, i added a unit test to test this and it passes just fine.
The latest build on Maven Central is: 1.0.64
from jsondb-core.
@FarooqKhan
Thank you, the issue is resolved. Do you have a wiki that you could put this on?
from jsondb-core.
Related Issues (20)
- Generated resources during test execution not deleted afterwards
- No way to "flush" database HOT 2
- Provide security contact info HOT 2
- Modified json file make collectionExist return false HOT 2
- Android does not find any classes HOT 2
- Recursive data structures. Cycles not supported
- JDK 15 compliance
- jsonDBTemplate.findAll(Instance.class, comparator) HOT 4
- xpath lower-case() find. HOT 1
- ndjson parse example
- File Writes Are Not Thread Safe HOT 2
- invalid json format HOT 1
- No class found with @Document Annotation and attribute collectionName as: User, Android HOT 2
- Method for fast retrieval of collection size
- TURN OFF ERROR HANDLING IN MAVEN RELEASES, PLEASE
- Bug: Multiple SchemaUpdates (Rename) not possible
- One file for each item in a collection HOT 3
- Symlinks broken HOT 2
- getCollection always return the last item HOT 1
- Failed to acquire lock for collection file ClosedChannelException
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsondb-core.