problem with object in mulitple lists [message #606990] |
Thu, 14 June 2007 11:17 |
Eclipse User |
|
|
|
I have a case where TypeC extends TypeB, which extends TypeA. TypeC has an
EList<TypeB> getter method. If I have two instances of TypeC, and add the
same instance of TypeB to the ELists in both instances of TypeC, it doesn't
work. The first TypeC's EList has the position where the TypeB object
should have been set to null.
I created a test using the names listed above, created two TypeB objects
named TestNameB1 and TestNameB2, and then added both to an instance of
TypeC, and only TestNameB1 to a second instance of TypeC. Here is the
output when I spit them out to the console. The "members" is a println of
the EList.
typeC:com.syntellect.test.model.impl.TypeCImpl@178655 (name: TestNameC1)
members:[[null, com.syntellect.test.model.impl.TypeBImpl@1be4663 (name:
TestNameB2) (someData: Some test data2)]]
typeC:com.syntellect.test.model.impl.TypeCImpl@746ad0 (name: TestNameC2)
members:[[com.syntellect.test.model.impl.TypeBImpl@d8a1a0 (name:
TestNameB1) (someData: Some test data1)]]
Note the null in the first position of the first TypeC's list. If don't add
TestNameB1 to the second TypeC, the first position is filled fine, as it
should be.
Thanks,
Paul
|
|
|
Powered by
FUDForum. Page generated in 0.06170 seconds