This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If I nest JavaSource tasks as follows nested tasks still run over the snapshot of the most outer task. JavaSource.runUserActionTask { // document modifications JavaSource.runModificationTask { String text = CompilerInfo.getText(); // text without outer task modifications } } This usecase has worked before rewriting java.source to Parsing API.
It's a complicated problem, the java requirements are different from the requirements of embedded languages, which require the same top level snapshot to be used during the whole run.
Reassigning to correct owner.
You should create two separate tasks. JavaSource.runUserActionTask { // document modifications } JavaSource.runModificationTask { String text = CompilerInfo.getText(); // text without outer task modifications } And in the second task you can check version of document.
Do not forgot to update the Javadoc of the JavaSource as it's an incompatible API change. @since ..... nested task does not see changes from outer task