Open mminot-yseop opened 3 months ago
With Maven project maven.compiler.release
= 21
I tried converting an if-else chain with startsWith
to a switch as per https://stackoverflow.com/a/77595373/2746335
Looks like the when
clause confuses the formatter.
I'm on Intellij Build #IU-241.17011.2, built on May 7, 2024
Hi.
With
23.4.223.000.0-Eclipse_2023-03
, I run into a strange issue: some methods are just skipped rather than formatted, while the rest of the file is processed just fine, and the conditions for this to happen seem to be:when(…)
worked fine. We don’t use Mockito in business code, so…)AND
when(…)
call (rather thanMockito.when(…)
).Adding another statement before the
when(…)
, even if it’s just a lone;
, fixes the issue. Other methods do not seem to cause this issue; even other Mockito methods likemock()
seem to be OK.Somewhere under a Test Sources Root directory, create a file like:
Something consistent, along the lines of (depending on the config):
The whole method is not formatted, only what surrounds it is. There is no crash though: the formatter looks happy.
eclipse-adapter-formatter-bug-static.webm