One year later I've found out that this task is better accomplished with the help of a good general-purpose text-editor, such as emacs or vim, instead of IDEs (NetBeans, Eclipse, etc).
In this case, the better text editor is the one which the user is already used to, Emacs in my case. Multiple cursors package easily solves this. Another option is to use the native query-replace
function (bounded to M-%
by default).