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 185457 - Support AnnotationProcessingQuery.Result.sourceOutputDirectory
Summary: Support AnnotationProcessingQuery.Result.sourceOutputDirectory
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: apireviews
URL:
Keywords: API_REVIEW_FAST
Depends on: 185974
Blocks: 134990
  Show dependency tree
 
Reported: 2010-05-04 18:06 UTC by Tomas Zezula
Modified: 2010-06-04 16:21 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff file (17.88 KB, patch)
2010-05-11 14:10 UTC, Tomas Zezula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2010-05-04 18:06:01 UTC
Currently the freeform has no configuration fragment to store source output directory. Having it on the source path causes intensive rescans after build.
Comment 1 jessholle 2010-05-11 11:26:41 UTC
Is there any estimate as to when this will be addressed?

I'd like to test this fix in our environment sooner than later.
Comment 2 Tomas Zezula 2010-05-11 11:39:34 UTC
I will hopefully attach a diff for api review today.
Comment 3 Tomas Zezula 2010-05-11 14:10:03 UTC
Created attachment 98773 [details]
Diff file
Comment 4 Tomas Zezula 2010-05-11 14:19:54 UTC
The freeform-project-java-3.xsd has changed to support AP. The classpath of type processor has moved into a new compilation unit section (annotation-processing) which supports also source-output, triggers, explicit processors and processor options.
The example of the cu with annotation-processing element:

<compilation-unit>
   <package-root>src</package-root>
    <classpath mode="compile">lib/TestProcessor.jar</classpath>
    <built-to>build</built-to>
    <source-level>1.6</source-level>
    <annotation-processing>
        <scan-trigger/>            <!-- AP invoked in initial scan and after file save->
         <editor-trigger/>         <!-- AP invoked after each change in editor (may slow down edits, for j2seproject not enabled by default)->
         <source-output>gen-src</source-output>     <!--where are the AP generated sources, the sources should not be a part of any cu! -->
         <processor-path>lib/TestProcessor.jar</processor-path> <!-- Not needed as the processor is on comple cp -->
         <processor-option>
             <key>test_ap_key</key>
             <value>test_ap_value</value>
         </processor-option>
         <processor-option>
             <key>another_test_ap_key</key>
             <value>another_test_ap_value</value>
         </processor-option>
     </annotation-processing>
</compilation-unit>
Comment 5 Tomas Zezula 2010-05-11 14:21:36 UTC
Changed the freeform-project-java-3.xsd to support the APQuery.Result.
Comment 6 jessholle 2010-05-11 14:30:16 UTC
Looks nice overall.

So the processor-path replaces classpath mode="processor"?
Comment 7 Tomas Zezula 2010-05-11 14:57:44 UTC
>So the processor-path replaces classpath mode="processor"?
Yes
Comment 8 Jesse Glick 2010-05-11 17:36:18 UTC
Looks OK to me.
Comment 9 Tomas Zezula 2010-05-11 18:21:30 UTC
Thanks,
I will integrate it tomorrow.
Comment 10 Tomas Zezula 2010-05-12 07:42:17 UTC
Fixed in jet-main a3754e9b1d3a
Comment 11 Quality Engineering 2010-05-14 04:02:24 UTC
Integrated into 'main-golden', will be available in build *201005132200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/
User: 
Log:
Comment 12 jessholle 2010-05-14 18:11:55 UTC
Seems to work alright!
Comment 13 Tomas Zezula 2010-05-14 18:15:57 UTC
OK.
Thanks for your help!
Comment 14 jessholle 2010-05-14 18:20:29 UTC
On a somewhat unrelated note, I made the mistake of trying to use go-to-type in the midst of scanning.  I actually got a type in the dialog, so I selected it.  The UI then stopped handling any/all input for just over an hour.  I almost killed NetBeans during this, but I decided to see if it would snap out of it.  It did, but I'm not sure if it would ever be acceptable to wait an hour for it to do so.

This goes back to the old issue -- scanning should not block any actions and should incrementally build/update the scan/completion database.
Comment 15 Tomas Zezula 2010-05-14 18:37:31 UTC
If you have a tread dump please attach it to this issue or create a new one. Several successive thread dump are even better to find out possible live lock. It may be related to deadlock and in some cases only large delay in FileSystems - issue #185900 which is now fixed. But I am not sure.

> scanning should not block any actions and should incrementally build/update the scan/completion >database
I am working on prototype of this in my free time. There are several API incompatibilities, the biggest problem is 2 concurrent threads doing IO, which is not so bad when parts of caches are in memory -J-Djava.index.useMemCache=true. Anyway the Go To Type (when the file is found) should not be blocked by scanning even today, when the IDE is busy with scanning it should just open the file at the beginning.