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.

Bug 162853 - JavaSource nested task does not see changes from outer task
Summary: JavaSource nested task does not see changes from outer task
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Jancura
URL:
Keywords:
Depends on:
Blocks: 162630
  Show dependency tree
 
Reported: 2009-04-16 15:30 UTC by Jan Pokorsky
Modified: 2009-05-07 14:12 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2009-04-16 15:30:20 UTC
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.
Comment 1 Tomas Zezula 2009-04-16 15:39:01 UTC
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.
Comment 2 Rastislav Komara 2009-04-29 13:04:07 UTC
Reassigning to correct owner.
Comment 3 Jan Jancura 2009-05-07 13:51:57 UTC
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.
Comment 4 Tomas Zezula 2009-05-07 14:12:05 UTC
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