aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/core/configuration/ConfigurationFile.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/lombok/core/configuration/ConfigurationFile.java b/src/core/lombok/core/configuration/ConfigurationFile.java
index 9a5e97e3..8e4e687c 100644
--- a/src/core/lombok/core/configuration/ConfigurationFile.java
+++ b/src/core/lombok/core/configuration/ConfigurationFile.java
@@ -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) {