Project

General

Profile

Revision 0d79c535

ID0d79c5359c48c1b0e06f6d916214b822bf8d53d7
Parent b61431ee
Child a2533432

Added by Andreas Müller 12 months ago

ref #6794 remove references to TermVocabulary.iterator()

View differences:

cdmlib-model/src/test/java/eu/etaxonomy/cdm/model/term/TermVocabularyTest.java
15 15
import static org.junit.Assert.assertTrue;
16 16

  
17 17
import java.net.URI;
18
import java.util.Iterator;
19 18
import java.util.Set;
20 19
import java.util.SortedSet;
21 20
import java.util.TreeSet;
......
27 26
import org.junit.BeforeClass;
28 27
import org.junit.Test;
29 28

  
30
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
31
import eu.etaxonomy.cdm.model.term.OrderedTermBase;
32
import eu.etaxonomy.cdm.model.term.TermType;
33
import eu.etaxonomy.cdm.model.term.TermVocabulary;
34 29
import eu.etaxonomy.cdm.test.unit.EntityTestBase;
35 30

  
36 31

  
......
199 194
//		assertEquals(dtb1.getClass(), voc1.getTermClass());
200 195
	}
201 196

  
202
	@Test
203
	public final void testIterator() {
204
		Iterator<DefinedTermBase<?>> it = voc1.iterator();
205
		int i = 0;
206
		while (it.hasNext()){
207
			i++;
208
			assertTrue(voc1.getTerms().contains(it.next()));
209
		}
210
		assertEquals(3, i);
211
	}
197
//	@Test
198
//	public final void testIterator() {
199
//		Iterator<DefinedTermBase<?>> it = voc1.iterator();
200
//		int i = 0;
201
//		while (it.hasNext()){
202
//			i++;
203
//			assertTrue(voc1.getTerms().contains(it.next()));
204
//		}
205
//		assertEquals(3, i);
206
//	}
212 207
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/LocationServiceImpl.java
150 150

  
151 151
        OrderedTermVocabulary<NamedArea> vocabulary = getNamedAreaVocabulary(vocabularyType);
152 152

  
153
        List<NamedArea> topLevelTerms = new ArrayList<NamedArea>();
153
        List<NamedArea> topLevelTerms = new ArrayList<>();
154 154

  
155 155
//		for(NamedArea area : vocabulary){
156
        Iterator<NamedArea> it = vocabulary.iterator();
156
        Iterator<NamedArea> it = vocabulary.getTerms().iterator();
157 157
        while(it.hasNext()){
158 158

  
159 159
            NamedArea area =  HibernateProxyHelper.deproxy(it.next(), NamedArea.class);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)