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