getExistingEntityTypeId should return Integer instead of int

Fixes #804
This commit is contained in:
Brokkonaut
2020-08-31 00:28:12 +02:00
parent d548206c3a
commit 42715de265
2 changed files with 4 additions and 3 deletions

View File

@ -16,7 +16,7 @@ public class EntityTypeConverter {
private static HashMap<EntityType, Integer> entityTypeToId = new HashMap<>();
private static int nextEntityTypeId;
public synchronized static int getExistingEntityTypeId(EntityType entityType) {
public synchronized static Integer getExistingEntityTypeId(EntityType entityType) {
return entityType == null ? null : entityTypeToId.get(entityType);
}

View File

@ -1043,8 +1043,9 @@ public final class QueryParams implements Cloneable {
private Set<Integer> getEntityTypeIds() {
HashSet<Integer> typeIds = new HashSet<>();
for (EntityType type : entityTypes) {
if (type != null) {
typeIds.add(EntityTypeConverter.getExistingEntityTypeId(type));
Integer id = EntityTypeConverter.getExistingEntityTypeId(type);
if (id != null) {
typeIds.add(id);
}
}
// add invalid id, so the type list is not ignored