Bug 205998

Summary: Closing a file in RoundCompleteListener should be supported
Product: [Eclipse Project] JDT Reporter: Walter Harley <eclipse>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
sample processor that shows bug none

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.