/* match end boundary */"(" + grammarSeparator + "|" + Pattern.quote(".*") + "|" + Pattern.quote("\\") + "|$)");
/* find all matches to replace and add them to the root edit */
Matcher matcher = pattern.matcher(bndFileText);
while (matcher.find()) {
rootEdit.addChild(new ReplaceEdit(matcher.start(2), matcher.group(2).length(), newName));
}
pattern = Pattern.compile(
/* match start boundary */"(^|" + grammarSeparator + ")" +
/* match bundle activator */"(Bundle-Activator\\s*:\\s*)" +
/* match itself / package name */"(" + Pattern.quote(oldName) + ")" +
/* match class name */"(\\.[^\\.]+)" +
/* match end boundary */"(" + grammarSeparator + "|" + Pattern.quote("\\") + "|$)");
/* find all matches to replace and add them to the root edit */
matcher = pattern.matcher(bndFileText);
while (matcher.find()) {
rootEdit.addChild(new ReplaceEdit(matcher.start(3), matcher.group(3).length(), newName));
}
}
/*
* only store the changes when no changes were stored before for this file and when there are actually