Closed aner-perez closed 8 years ago
Why not come up with a pull request that showed at least the results of your analysis ;-) ?
Pull request #48 was created. Previous analysis was wrong, it turned out to be a method signature change in CollectionMemberAndAccessorFactory which was not applied to the overridden method in CollectionJ2NoIndexMemberAndAccessorFactory.
Adding the following in bindings.xml generates code that does not compile.
Specifically, the generated class includes the following code:
This code does not compile because
java.util.Set
does not have aget(int index)
methodLooking at
org.exolab.castor.builder.factory.CollectionMemberAndAccessorFactory
line 331 calls:Either
createGetAndSetMethods(...)
orcreateGetByIndexMethod(...)
should check if the collection is aSet
orSortedSet
and skip the generation of this method. You could also add aboolean hasGetByIndex()
method toJCollectionType
to make this code cleaner.