//
int n = changes.size();
if (n > 0) {
Replacement[] repls = (Replacement[]) changes.toArray(new Replacement[n]);
Arrays.sort(repls);
StringCopier copier = new StringCopier(source);
for (int i = 0; i < n; ++i) {
Replacement repl = repls[i];
copier.commit(repl.text, repl.start, repl.end);
}
char[] results = copier.finish();
return new CompilationUnitProviderWithAlternateSource(cup, results);
} else {
// No changes were made, so we return the original.
//