Community
Participate
Working Groups
We need to switch our context model and java resource model to take advantage of Iterable instead of Iterator. Some of the provisional API already uses Iterable in Helios, but we should change all of it.
Going to wait on this until Brian is finished with the huge refactoring in bug 233567
I have changed our core model API that uses Iterator and ListIterator to use Iterable and ListIterable. The methods were also renamed to include a "get" prefix.
Here are a few examples of the changes that were made. This pattern has been followed throughout the model. In package org.eclipse.jpt.jpa.core.context PersistentType.allAttributes():Iterator -> getAllAttributes():Iterable In package org.eclipse.jpt.jpa.core.context.persistence Persistence.persistenceUnits():Iterator -> getPersistenceUnits():Iterable Persistence.persistenceUnitsSize() -> getPersistenceUnitsSize() PersistenceUnit.classRefs():Iterator -> getClassRefs():Iterable PersistenceUnit.classRefsSize() -> getClassRefsSize() PersistenceUnit.mappingFileRefs():Iterator -> getMappingFileRefs():Iterable PersistenceUnit.mappingFileRefsSize() -> getMappingFileRefsSize()
Some more examples where this change was made JavaResourceAnnotatedElement.annotations(String, String) - changed to getAnnotations(String) : Iterable JavaResourceAnnotatedElement.annotations(String) - changed to getAnnotations() : Iterable PersistentType.attributes() : ListIterator changed to getAttributes() : ListIterable PersistenceUnit.mappingFileRefsContaining(...) changed to getMappingFileRefsContaining(String) : Iterable