Structural Search/Replace with multiple annotations

Answered

Is there any documentation that might guide me with dealing with a search/replace for code similar to:


@Override
@SuppressWarnings(value={"unchecked", "deprecation"})
public P runit() {
var x = 1
}

When the replacement occurs, the Annotations are not correct:

@Override SuppressWarnings

 

The search/replace looks like:

 

<replaceConfiguration name="Annotated methods" text="@$Annotation$&#10;$MethodType$ $Method$($ParameterType$ $Parameter$){&#10; $Statement$;&#10;};" recursive="false" caseInsensitive="true" type="JAVA" pattern_context="member" reformatAccordingToStyle="false" shortenFQN="false" replacement="@$Annotation$&#10;$MethodType$ runit($ParameterType$ $Parameter$){&#10; $Statement$;&#10;};">
<constraint name="__context__" within="" contains="" />
<constraint name="Annotation" maxCount="2147483647" within="" contains="" />
<constraint name="MethodType" within="" contains="" />
<constraint name="Method" regexp="run" target="true" within="" contains="" />
<constraint name="ParameterType" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="Statement" minCount="0" maxCount="2147483647" within="" contains="" />
</replaceConfiguration>
0
2 comments

Seems to be a bug after adding the count filter. 

Please file an issue at https://youtrack.jetbrains.com/newIssue?project=IDEA

0

Thank you.  Logged issue: IDEA-263971

0

Please sign in to leave a comment.