forked from LogBlock/LogBlock
getExistingEntityTypeId should return Integer instead of int
Fixes #804
This commit is contained in:
@@ -16,7 +16,7 @@ public class EntityTypeConverter {
|
|||||||
private static HashMap<EntityType, Integer> entityTypeToId = new HashMap<>();
|
private static HashMap<EntityType, Integer> entityTypeToId = new HashMap<>();
|
||||||
private static int nextEntityTypeId;
|
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);
|
return entityType == null ? null : entityTypeToId.get(entityType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1043,8 +1043,9 @@ public final class QueryParams implements Cloneable {
|
|||||||
private Set<Integer> getEntityTypeIds() {
|
private Set<Integer> getEntityTypeIds() {
|
||||||
HashSet<Integer> typeIds = new HashSet<>();
|
HashSet<Integer> typeIds = new HashSet<>();
|
||||||
for (EntityType type : entityTypes) {
|
for (EntityType type : entityTypes) {
|
||||||
if (type != null) {
|
Integer id = EntityTypeConverter.getExistingEntityTypeId(type);
|
||||||
typeIds.add(EntityTypeConverter.getExistingEntityTypeId(type));
|
if (id != null) {
|
||||||
|
typeIds.add(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add invalid id, so the type list is not ignored
|
// add invalid id, so the type list is not ignored
|
||||||
|
Reference in New Issue
Block a user