It's odd, that looks a lot like a bug that was fixed in 18.0.1.1, so the fix should already be in your trial. And I don't seem to be able to reproduce it from the trial I just downloaded, using just the source text provided in your post. Just for paranoia's sake, check the Help -> About box and make sure it's reporting 18.0.1.2.
Otherwise, to narrow it down, bring up your source file, and go to Document -> Java Options, and uncheck "Beautify while typing" if it's checked, and then see if you can still reproduce the problem.