Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricted Identifier Error in Eclipse when using Mockitos when #1536

Closed
vg-scylla opened this issue Oct 30, 2023 · 1 comment
Closed

Restricted Identifier Error in Eclipse when using Mockitos when #1536

vg-scylla opened this issue Oct 30, 2023 · 1 comment

Comments

@vg-scylla
Copy link

vg-scylla commented Oct 30, 2023

Eclipse shows an Error (Syntax error on token "RestrictedIdentifierWhen", delete this token) when using the Mockito when method which is a static import.

The error is just shown for the first occurence of a 'when' in a test Method.

If i see it correctly 'when' is a restricted identifiers in a 'switch case' statement.

Workarround is to use the fully qualified name org.mockito.Mockito.when.

I use the following version:

Eclipse JDT (Java Development Tools) Patch with Java 21 support for 2023-09 development stream 1.2.300.v20230920-0334_BETA_JAVA21 org.eclipse.jdt.java21patch.feature.group Eclipse.org

RestrictedIdentifierWhenExample.txt

@iloveeclipse
Copy link
Member

Duplicate of #456.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants