Project

General

Profile

« Previous | Next » 

Revision 60e8c5d1

Added by Andreas Müller over 6 years ago

cleanup

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java
37 37
/**
38 38
 * @author n.hoffmann
39 39
 * @created 03.06.2009
40
 *
41
 * @deprecated
42
 * A static list of vocabularies is not the right way to do this.
43
 * We will use a service method that will return vocabularies by term type (once that is implemented)
44
 */
40
 **/
45 41
@Deprecated
46 42
public enum VocabularyEnum {
47 43

  
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/init/TermLoader.java
56 56
			CSVReader reader = getCsvReader(vocType);
57 57
			String[] nextLine = reader.readNext();
58 58
			UUID uuidVocabulary = UUID.fromString(nextLine[0]);
59
			Set<UUID> termSet = new HashSet<UUID>();
59
			Set<UUID> termSet = new HashSet<>();
60 60
			uuidMap.put(uuidVocabulary, termSet);
61 61

  
62 62
			while ( (nextLine = reader.readNext()) != null) {
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/PersistentTermInitializer.java
101 101
            logger.info("PersistentTermInitializer.omit == true, returning without initializing terms");
102 102
            return;
103 103
        } else {
104
            Map<UUID,DefinedTermBase> terms = new HashMap<UUID,DefinedTermBase>();
104
            Map<UUID,DefinedTermBase> terms = new HashMap<>();
105 105
            logger.info("PersistentTermInitializer.omit == false, initializing " + VocabularyEnum.values().length + " term classes");
106 106

  
107 107
            DateTime start = new DateTime();
......
110 110

  
111 111
            //load uuids from csv files
112 112
            logger.info("Start new ... " );
113
            Map<UUID, Set<UUID>> uuidMap = new HashMap<UUID, Set<UUID>>();
114
            Map<UUID, VocabularyEnum> vocTypeMap = new HashMap<UUID, VocabularyEnum>();
113
            Map<UUID, Set<UUID>> uuidMap = new HashMap<>();
114
            Map<UUID, VocabularyEnum> vocTypeMap = new HashMap<>();
115 115

  
116 116
            for(VocabularyEnum vocabularyType : VocabularyEnum.values()) {
117 117
                UUID vocUUID = termLoader.loadUuids(vocabularyType, uuidMap);
......
123 123

  
124 124
            //find and create missing terms and load vocabularies from repository
125 125
            logger.info("Create missing terms ... " );
126
            Map<UUID, TermVocabulary<?>> vocabularyMap = new HashMap<UUID, TermVocabulary<?>>();
127
            Map<UUID, Set<UUID>> missingTermUuids = new HashMap<UUID, Set<UUID>>();
126
            Map<UUID, TermVocabulary<?>> vocabularyMap = new HashMap<>();
127
            Map<UUID, Set<UUID>> missingTermUuids = new HashMap<>();
128 128

  
129 129
            vocabularyDao.missingTermUuids(uuidMap, missingTermUuids, vocabularyMap);
130 130

  
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/TermVocabularyDaoImpl.java
167 167
			Map<UUID, Set<UUID>> uuidMissingTermsRepsonse,
168 168
			Map<UUID, TermVocabulary<?>> vocabularyResponse){
169 169

  
170
		Set<UUID> missingTermCandidateUuids = new HashSet<UUID>();
170
		Set<UUID> missingTermCandidateUuids = new HashSet<>();
171 171

  
172 172
		for (Set<UUID> uuidsPerVocSet : uuidsRequested.values()){
173 173
			missingTermCandidateUuids.addAll(uuidsPerVocSet);
......
213 213
					if (missingTermCandidateUuids.contains(termUuid)){
214 214
						Set<UUID> r = uuidMissingTermsRepsonse.get(vocUUID);
215 215
						if (r == null){
216
							r = new HashSet<UUID>();
216
							r = new HashSet<>();
217 217
							uuidMissingTermsRepsonse.put(vocUUID, r);
218 218
						}
219 219
						r.add(termUuid);

Also available in: Unified diff