diff --git a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/scoping/AbstractRecursiveScope.java b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/scoping/AbstractRecursiveScope.java index 1fcba547f..b82660798 100644 --- a/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/scoping/AbstractRecursiveScope.java +++ b/com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/scoping/AbstractRecursiveScope.java @@ -142,11 +142,11 @@ public synchronized IEObjectDescription getSingleElement(final QualifiedName nam while (result == null && contentsIterator.hasNext()) { result = contentsIterator.next(); QualifiedName thisName = result.getName(); - if (isIgnoreCase()) { - thisName = thisName.toLowerCase(); // NOPMD UseLocaleWithCaseConversions - } - if (!isIgnoreCase() || nameCache.get(thisName) == null) { + if (!isIgnoreCase()) { nameCache.put(thisName, result); + } else { + thisName = thisName.toLowerCase(); // NOPMD UseLocaleWithCaseConversions + nameCache.putIfAbsent(thisName, result); } if (!lookupName.equals(thisName)) { result = null; // NOPMD NullAssignment