From 99745de3905401f352d3cca71cca0768fbedd498 Mon Sep 17 00:00:00 2001 From: mmews Date: Fri, 19 Jul 2024 13:44:25 +0200 Subject: [PATCH] fix --- .../validators/N4JSDeclaredNameValidator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)),