diff --git a/jscl/src/main/java/org/solovyev/common/math/AbstractMathRegistry.java b/jscl/src/main/java/org/solovyev/common/math/AbstractMathRegistry.java index 2a80c703..97797e9c 100644 --- a/jscl/src/main/java/org/solovyev/common/math/AbstractMathRegistry.java +++ b/jscl/src/main/java/org/solovyev/common/math/AbstractMathRegistry.java @@ -23,6 +23,7 @@ package org.solovyev.common.math; import org.solovyev.common.collections.SortedList; +import org.solovyev.common.text.Strings; import java.util.ArrayList; import java.util.Comparator; @@ -168,9 +169,13 @@ public abstract class AbstractMathRegistry implements Math @Nonnull public List getNames() { synchronized (this) { - if (entityNames.isEmpty()) { - for (T entity : entities) { - entityNames.add(entity.getName()); + if (!entityNames.isEmpty()) { + return entityNames; + } + for (T entity : entities) { + final String name = entity.getName(); + if (!Strings.isEmpty(name)) { + entityNames.add(name); } } return entityNames;