From: Peter C. M. <Pet...@na...> - 2008-07-11 18:55:23
|
we don't do any modeling of java.util collections, i.e. use the plain library classes, so you have to use 'javap -p' to get the field names. There is nothing special about setting their field values, which is done with PUTFIELD insns from the library code. Apart from being a bit tedious, the problem with your approach is that you only have an interface (java.util.List), whereas you need a concrete implementor to know about the field names. From an MJI perspective, it's much easier to deal with simple arrays, at least until we have an MJI utility that allows us to iterate over JPF-object collections. -- Peter On Jul 11, 2008, at 11:41 AM, Cato Pakusch wrote: > Hey guys > > I need to use MJI to traverse a couple collections. Basically, my > model class declares the method with this: > > > static native void PrintList(List<Integer> l); > > > and I'll implement it in a native peer class. In my native peer > class, I'll get access to the elements / objects of the collection > by using methods such as getReferenceField and getIntField. > > Now to the problem. Getting these fields, require a call made with a > couple arguments as int and String, where the String is the field > name of the value that I'm getting. So I need to know how JPF sets > all the field names for its collections, in order to get out the > correct fields. I've been searching up and down in the source code > to find the code that sets the fields, but I cannot find it. Any > pointers please? > > Best regards, > Cato |