mirror of
https://github.com/tiennm99/lombok.git
synced 2026-06-08 22:15:15 +00:00
Merge pull request #3358 from dreis2211/config-parent-cache
Cache ConfigurationFile.parent()
This commit is contained in:
@@ -110,7 +110,8 @@ public abstract class ConfigurationFile {
|
||||
|
||||
private static class RegularConfigurationFile extends ConfigurationFile {
|
||||
private final File file;
|
||||
|
||||
private ConfigurationFile parent;
|
||||
|
||||
private RegularConfigurationFile(File file) {
|
||||
super(file.getPath());
|
||||
this.file = file;
|
||||
@@ -173,8 +174,11 @@ public abstract class ConfigurationFile {
|
||||
}
|
||||
|
||||
@Override ConfigurationFile parent() {
|
||||
File parent = file.getParentFile().getParentFile();
|
||||
return parent == null ? null : forDirectory(parent);
|
||||
if (parent == null) {
|
||||
File parentFile = file.getParentFile().getParentFile();
|
||||
parent = parentFile == null ? null : forDirectory(parentFile);
|
||||
}
|
||||
return parent;
|
||||
}
|
||||
|
||||
private static String replaceEnvironmentVariables(String fileName) {
|
||||
|
||||
Reference in New Issue
Block a user