Live Template Variables - methodParameters() expansion problem


I have created a new live template with variables as per

When I use a live template as follows
Preconditions.checkNotNullArgument($parameter$, "$parameter$");

where $parameter$ is defined as methodParameters()

When used within a method, it expands as follows
public final SERVERTHEN replyWith(Object response) {
     Preconditions.checkNotNullArgument([response], "[response]");


Is there a reason why the square brackets are included in the expansion? In each case I need to remove them from the parameter name to get the statement to compile?

I am running 12.1.1 Ultimate edition.

Thank you.

1 comment
Comment actions Permalink


Looks like that's done intentionally: since we can't predict what exactly user want to do with many parameters, he has to write some custom processor.

Take a look at bundled *soutp* template: it uses methodParameters(), maybe that idea is good for you.



Please sign in to leave a comment.