This content has been marked as final. Show 4 replies
Can you ensure that your Vector has been initialized. One easy check would be to lazily initialize it:
Vector myCollection = new Vector();
This is not an error message, this is the toString, the indirect list toString avoids instantiating the collection so prints this. To force it to instantiate first you can send it a message such as size().
i instantiated my vector in the java object, and still receive the same error
I would just like to re-iterate that the output you are seeing "IndirectList: not instantiated" is NOT an error message. The print instruction you have called results in the toString being invoked on the indirect collection. We have specifically coded the Indirect collection types to not instantiate their collections when a toString is invoked. This could lead to an unexpected performance issue.
If you want the printing of your objects to instantiate the indirect collection then I would recommend writing a toString method on your class that forces this to happen. With an indirect collection you need to access the collection values themselves to force it to be read in. The easiest way of doing this would be to call size() on the indirect collection.