Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319736

Summary: Switch to use Iterable instead of Iterator throughout our provisional API
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: GeneralAssignee: Karen Butzke <karenfbutzke>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: neil.hauge
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 233567    
Bug Blocks:    

Description Karen Butzke CLA 2010-07-13 10:59:21 EDT
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.
Comment 1 Karen Butzke CLA 2010-10-26 16:11:50 EDT
Going to wait on this until Brian is finished with the huge refactoring in bug 233567
Comment 2 Karen Butzke CLA 2011-08-02 16:42:16 EDT
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.
Comment 3 Karen Butzke CLA 2012-02-02 11:22:55 EST
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()
Comment 4 Karen Butzke CLA 2012-04-20 15:58:02 EDT
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