-
Notifications
You must be signed in to change notification settings - Fork 137
8373825: [lworld] ForwardingFileManager always closes its delegate leading to ClosedFileSystemException in TestOriginatingElements #1810
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
base: lworld
Are you sure you want to change the base?
Changes from all commits
5b78050
d49af5d
d41fac6
1b29ac4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -856,17 +856,19 @@ private interface Content { | |
| * and delegates to a default file manager for input files. | ||
| */ | ||
| public MemoryFileManager() { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the vast majority of users, they don't care about the delegated instance and want it closed. |
||
| this(ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null)); | ||
| this(ToolProvider.getSystemJavaCompiler().getStandardFileManager(null, null, null), true); | ||
| } | ||
|
|
||
| /** | ||
| * Constructs a memory file manager which stores output files in memory, | ||
| * and delegates to a specified file manager for input files. | ||
| * | ||
| * @param fileManager the file manager to be used for input files | ||
| * @param shouldClose whether the delegate file manager should be closed | ||
| * when this instance is closed | ||
| */ | ||
| public MemoryFileManager(JavaFileManager fileManager) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only called in 2 places, so migrating callers with an extra parameter is easy. |
||
| super(fileManager); | ||
| public MemoryFileManager(JavaFileManager fileManager, boolean shouldClose) { | ||
| super(fileManager, shouldClose); | ||
| files = new HashMap<>(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could leave this alone, but it seemed nicer to actually acknowledge that the file managers are closeable.