Issue with nested containers
Got issue with creating garbage objects when objects has nested containers. I have class which has List field with nested ArrayList elements. Got this stack trace when running my tests:
java.lang.NoSuchMethodException:
[] at java.lang.Class.getConstructor(Class.java:531) at java.lang.Class.getDeclaredConstructor(Class.java:510) at com.commit451.parcelcheck.ObjectHelper.getTestObject(ObjectHelper.java:130) at com.commit451.parcelcheck.ObjectHelper.getObjectForClass(ObjectHelper.java:91) at com.commit451.parcelcheck.ObjectHelper.addObjectToCollection(ObjectHelper.java:145) at com.commit451.parcelcheck.ObjectHelper.getObjectForClass(ObjectHelper.java:86) at com.commit451.parcelcheck.ObjectHelper.fillWithGarbage(ObjectHelper.java:52)
So something like this?:
public class Person {
ArrayList<ArrayList<String>> groceryLists;
}
Like this
public class Person { ArrayList<GroceryList> groceryLists; }
public class GroceryList extends ArrayList<String> { }
Looks like the specific crash you are seeing happens when there is not an empty constructor on your parcelable object (which will be more clear in the next version). However there is an issue that exists when dealing with classes extending a generic type, which is being taken care of.