To answer your query on text edits, yes, you should use text edits to have the change - this is not a big thing, since you need to create a rewriter, get the edits from edits = rewriter.rewrite(doc) and then apply the edits by edits.apply(doc);
If you have the JDT.Core sources, then you can also have a look at the testcase org.eclipse.jdt.core.tests.rewrite.describing.ASTRewritingStatementsTest.testSwitchStatement13() for the usage.
Despite trying the above, if you are stuck with the issue, please attach a shortened, self-contained version of the program that demonstrates the issue.
-----[hidden email] wrote: -----
To: "Eclipse JDT general developers list." <[hidden email]>
From: Kenneth Styrberg
Sent by: [hidden email] Date: 07/07/2020 07:51PM
Subject: [EXTERNAL] [jdt-dev] AST rewrite on other AST.
Hi, I'm trying to fix a bug where a modification needs to be done on a
Node (oldNode), that is in another CompilationUnit currently not in
scope for the ChangeProposal.