Polish "Prefer modified resources over the originals in TestCompiler"

See gh-33850
This commit is contained in:
Stéphane Nicoll 2024-11-06 23:03:11 +09:00
parent f6e1a5de09
commit 0219ee656f
1 changed files with 4 additions and 3 deletions

View File

@ -70,11 +70,12 @@ class DynamicJavaFileManager extends ForwardingJavaFileManager<JavaFileManager>
}
@Override
public FileObject getFileForOutput(Location location, String packageName, String relativeName, FileObject sibling) {
public FileObject getFileForOutput(Location location, String packageName,
String relativeName, FileObject sibling) {
return this.dynamicResourceFiles.computeIfAbsent(relativeName, name -> {
ResourceFile resourceFile = this.resourceFiles.get(name);
return (resourceFile != null) ? new DynamicResourceFileObject(name, resourceFile.getContent())
: new DynamicResourceFileObject(name);
return (resourceFile != null) ? new DynamicResourceFileObject(name, resourceFile.getContent()) :
new DynamicResourceFileObject(name);
});
}