fixed Tests & fallback

This commit is contained in:
Timo 2020-11-26 20:12:36 +02:00
parent cc1a3c9e49
commit 0e645ab273
2 changed files with 24 additions and 13 deletions

View File

@ -122,6 +122,26 @@ public class DictionaryService {
}
public boolean isCaseInsensitiveDictionary(String type) {
return localAccessMap.get(type).isCaseInsensitive();
DictionaryModel dictionaryModel = localAccessMap.get(type);
if (dictionaryModel != null) {
return dictionaryModel.isCaseInsensitive();
}
return false;
}
public float[] getColor(String type) {
DictionaryModel model = localAccessMap.get(type);
if (model != null) {
return model.getColor();
}
return defaultColor;
}
public boolean isHint(String type) {
DictionaryModel model = localAccessMap.get(type);
if (model != null) {
return model.isHint();
}
return false;
}
}

View File

@ -401,10 +401,7 @@ public class AnnotationHighlightService {
if (!entity.isRedaction() && !isHint(entity)) {
return dictionaryService.getNotRedactedColor();
}
if (!dictionaryService.getEntryColors().containsKey(entity.getType())) {
return dictionaryService.getDefaultColor();
}
return dictionaryService.getEntryColors().get(entity.getType());
return dictionaryService.getColor(entity.getType());
}
@ -420,18 +417,12 @@ public class AnnotationHighlightService {
private float[] getColor(String type) {
if (!dictionaryService.getEntryColors().containsKey(type)) {
return dictionaryService.getDefaultColor();
}
return dictionaryService.getEntryColors().get(type);
return dictionaryService.getColor(type);
}
private boolean isHint(Entity entity) {
List<String> hintTypes = dictionaryService.getHintTypes();
return CollectionUtils.isNotEmpty(hintTypes) && hintTypes.contains(entity.getType());
return dictionaryService.isHint(entity.getType());
}