In IDEA 4.5.4:
I was trying to add a method to all implementations of an interface, but could not get the correct output. Reducing the problem to a simple case of "add a method to this class" the replacement code is still broken.
As you can see, the initial comment block is wrong, lines following the // coment have been moved into the comment, and there is no new "foo" method.
I tried adding a semicolon after the $body$ in the search and replace templates, but now end up with:
which still has a broken initial comment block, and now has extra semicolons for all non-method lines in the class body.