Eclipse displayed a type safety warning and I tried nearly everything to eradicate it (of course suppressing it would be an option) but unfortunately I hadn't any success.
Do you know how I have to change my code so that there is no type safety warning anymore. Or is
ArrayList<String> arrayList= (ArrayList<String>) Classname.getArrayList();
JSONArray obj = new JSONArray();
The method addAll(Collection) belongs to the raw type ArrayList. References to generic type ArrayList should be parametrized
If you want to work with json go this library, this library has a nice support https://code.google.com/p/google-gson/.
This is an example:
Gson gson = new Gson(); Collection<Integer> ints = Lists.immutableList(1,2,3,4,5); (Serialization) String json = gson.toJson(ints); ==> json is [1,2,3,4,5]