SingleMemberAnnotation annotation = ast.newSingleMemberAnnotation();
annotation.setTypeName(ast.newSimpleName("PathVariable"));
StringLiteral pathVariableName = ast.newStringLiteral();
pathVariableName.setLiteralValue(variableName);
ITrackedNodePosition trackPathVariable = rewrite.track(pathVariableName);
addLinkedPosition(new StringLiteralTrackedPosition(trackPathVariable), true, "PathVariable");
annotation.setValue(pathVariableName);
isLinked = true;
ChildListPropertyDescriptor property;
property = SingleVariableDeclaration.MODIFIERS2_PROPERTY;
rewrite.getListRewrite(param, property).insertLast(annotation, null);
}
StringLiteral newTemplate = ast.newStringLiteral();
newTemplate.setLiteralValue(newTemplateString);
ITrackedNodePosition trackTemplateVariable = rewrite.track(newTemplate);
rewrite.replace(oldTemplate, newTemplate, null);
if (isLinked) {
addLinkedPosition(
new StringLiteralTrackedPosition(trackTemplateVariable, cursorOffset, variableName.length(), false),