Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: ECJ appears to flush custom JavaFileManager objects repeatedly #3502

Open
ascopes opened this issue Dec 31, 2024 · 8 comments
Open

[BUG]: ECJ appears to flush custom JavaFileManager objects repeatedly #3502

ascopes opened this issue Dec 31, 2024 · 8 comments
Labels
needinfo Further information is requested

Comments

@ascopes
Copy link
Contributor

ascopes commented Dec 31, 2024

Follow up of #958 (comment), as requested by @stephan-herrmann.

It appears that when using a custom JavaFileManager implementation, the call to .flush at the end of the compilation run is repeated numerous times. It seems to vary depending on what the project is doing but for less than a dozen source files, I have observed it being called more than 20 times in a row.

@jukzi jukzi added the needinfo Further information is requested label Jan 2, 2025
@jukzi
Copy link
Contributor

jukzi commented Jan 2, 2025

Please add info how to reproduce, what is the bad consequence and what you expect.

@ascopes
Copy link
Contributor Author

ascopes commented Jan 2, 2025

If you view the linked comment and thread, I have a library at github.com/ascopes/java-compiler-testing that has a feature/v5-ecj branch where I am integrating with ECJ.

If you enable compiler.fileManagerLoggingMode(LoggingMode.ENABLED) on any of the compiler integration tests such as https://github.com/ascopes/java-compiler-testing/blob/feature/v5-ecj/java-compiler-testing/src/test/java/io/github/ascopes/jct/integration/compilation/BasicLegacyCompilationIntegrationTest.java#L46, this will result in the library logging every since API call that ECJ makes to the JavaFileManager. For some test cases, I have seen a large number of consecutive flush calls at the end of the compilation process.

@jukzi
Copy link
Contributor

jukzi commented Jan 2, 2025

I have seen a large number of consecutive flush calls at the end of the compilation process.

Why is that a problem? Will you work on a fix? Without selfcontainig reproducer of a problem it is unlikely anybody else will work on it.

@ascopes
Copy link
Contributor Author

ascopes commented Jan 2, 2025

It is not a "problem" but ECJ calling flush 25 times rather than 1 does not feel like it is valid behaviour. Happy to close if it does not constitute an issue.

@jukzi
Copy link
Contributor

jukzi commented Jan 2, 2025

Closing as won't fix. Still anyone is invited to propose a PR to improve the code.

@jukzi jukzi closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
@szarnekow
Copy link
Contributor

@jukzi Stephan was working tirelessly with @ascopes in the past weeks to fix a bunch of things in this area and asked for small tickets explicitely. Please don't close tickets without exploring the context.

@szarnekow
Copy link
Contributor

Sadly I cannot reopen it.

@brychcy
Copy link
Contributor

brychcy commented Jan 2, 2025

I'll reopen it for now as requested.

@brychcy brychcy reopened this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants