RestrictedIdentifier Error in Eclipse for static import of org.mockito.Mockito.when

47 views
Skip to first unread message

Vol Gol

unread,
Oct 27, 2023, 11:53:45 AM10/27/23
to mockito
I am currently switching to Java 21 so far there are no real problems with Mockito.
But one thing is bothering me with Eclipse. In Test methods where i use "when" Eclipse shows me an Error that i am using an restricted Identifier (Syntax error on token "RestrictedIdentifierWhen", delete this token) .

One Workarround is to use the fully qualified name instead of the static import. 

Eclipse version: 2023-09 (4.29.0)
Mockito version: 5.6.0
JDTPlugin version: 1.2.300.v20230920-0334_BETA_JAVA21

This seems to be an Eclipse problem but maybe some of you have a better understanding how to resolve this.
Reply all
Reply to author
Forward
0 new messages