Bug 205998 - Closing a file in RoundCompleteListener should be supported
Summary: Closing a file in RoundCompleteListener should be supported
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Generic inbox for the JDT-APT component CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-10 20:51 EDT by Walter Harley CLA
Modified: 2022-08-12 11:28 EDT (History)
0 users

See Also:


Attachments
sample processor that shows bug (26.00 KB, application/octet-stream)
2007-10-10 20:51 EDT, Walter Harley CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Harley CLA 2007-10-10 20:51:27 EDT
Created attachment 80105 [details]
sample processor that shows bug

Per the description of rounding in http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html, it should be possible to create a Java source file in the process() method, and then close the resulting PrintWriter in a RoundCompleteListener.  This works in apt; the generated file is successfully written and compiled.  Note, though, that it does not work in apt to call createSourceFile() during the RoundCompleteListener.

In Eclipse this technique does not work.  The file is written, but it does not get compiled.  The problem is presumably that in APTDispatchRunnable we call reportResults() before we call the RoundCompleteListeners, and we report created files based on files that were closed, rather than files that were opened.

I'll attach a processor that can be used to demonstrate the problem.  To repro, put this processor jar on the classpath and factory path (or deploy it as a plugin) and process a file containing the org.example.anno.Generate annotation.

This bug only applies to the com.sun.mirror.apt implementation; in javax.annotation.processing (JSR269) RoundCompleteListener does not exist.
Comment 1 Eclipse Genie CLA 2020-08-18 14:51:40 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Eclipse Genie CLA 2022-08-12 11:28:38 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.