diff --git a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/validators/N4JSDeclaredNameValidator.java b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/validators/N4JSDeclaredNameValidator.java index 323789a28d..957a038f14 100644 --- a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/validators/N4JSDeclaredNameValidator.java +++ b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/validators/N4JSDeclaredNameValidator.java @@ -332,7 +332,7 @@ private void checkLocalScopeNamesConflict(VariableEnvironmentElement vee, ListMu EObject dupeEO = iter.next(); if (baseEO instanceof N4ClassExpression || dupeEO instanceof N4ClassExpression) { - return; + continue; } // in case of when we duplicate element creating given scope (like function names) @@ -350,7 +350,7 @@ private void checkLocalScopeNamesConflict(VariableEnvironmentElement vee, ListMu messageHelper.descriptionWithLine(baseEO, name)); addIssue(dupeEO, findNameEAttribute(dupeEO), issueItem); } - return; + continue; } // otherwise mark duplicates @@ -367,12 +367,12 @@ private void checkLocalScopeNamesConflict(VariableEnvironmentElement vee, ListMu /* * Duplication only between ImportSpecifiers is handled in N4JSImportValidator */ - return; + continue; } else { if (jsVariantHelper.isExternalMode(baseEO)) { // allow name sharing only in N4JSD files if (!isEqualNameDuplicate(baseEO, dupeEO)) { - return; + continue; } } @@ -641,7 +641,7 @@ private ListMultimap getLocalNames(VariableEnvironmentElement s * Returns nested scopes of 'scope'. Only direct sub-scopes of 'scope' are returned, no sub-sub-scopes, i.e. * sub-scopes of sub-scopes. */ - private Iterator getNestedScopes(final VariableEnvironmentElement scope) { + private Iterator getNestedScopes(VariableEnvironmentElement scope) { return filter(filter(EcoreUtilN4.getAllContentsFiltered(scope, it -> !(createsScope(it.eContainer()) && it.eContainer() != scope)), it -> createsScope(it)),