Structural Search/Replace help

Hi!

I'm trying to add logging in entering and exiting all the methods of a
class (I know this is a stupid thing to do, but as always: the customer
decided it).

I tried:

class $Class$ {
$ReturnType$ $MethodName$($ParameterType$ $Parameter$) {
$expr$;
}
}


replace by

class $Class$ {
$ReturnType$ $MethodName$($ParameterType$ $Parameter$) {
(my logging api here)
$expr$;
}
}

which worked. But now I want to exclude all get/set methods. So I edit
the variable MethodName and add a Text/regular expression (get|set).*
and check Invert Condition... and now it doesn't work : instead of
matching all the methods in my class, it matches the whole class, and
offers to replace only one method.

Any idea?

Thanks for your help.

BoD

2 comments
Comment actions Permalink

Any idea for that problem?
Thanks for your help.

BoD


BoD wrote:

Hi!

I'm trying to add logging in entering and exiting all the methods of a
class (I know this is a stupid thing to do, but as always: the customer
decided it).

I tried:

class $Class$ {
$ReturnType$ $MethodName$($ParameterType$ $Parameter$) {
$expr$;
}
}


replace by

class $Class$ {
$ReturnType$ $MethodName$($ParameterType$ $Parameter$) {
(my logging api here)
$expr$;
}
}

which worked. But now I want to exclude all get/set methods. So I edit
the variable MethodName and add a Text/regular expression (get|set).*
and check Invert Condition... and now it doesn't work : instead of
matching all the methods in my class, it matches the whole class, and
offers to replace only one method.

Any idea?

Thanks for your help.

BoD

0
Comment actions Permalink

FYI I posted the related issue to JIRA :

http://www.jetbrains.net/jira/browse/IDEA-4614

BoD

0

Please sign in to leave a comment.