From 3befb7323743d6b8c4f81e490cb6a8af196cc4fb Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 15 Jan 2018 20:07:02 +0300 Subject: [PATCH] findPusherValuesFromParent extracted --- .../roots/impl/PushedFilePropertiesUpdaterImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java index a9b5b1b73002..667bc3f5d93c 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java @@ -228,10 +228,7 @@ public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater final T value = pusher.getImmediateValue(project, dir); if (value != null) return value; if (moduleValue != null) return moduleValue; - final VirtualFile parent = dir.getParent(); - if (parent != null && ProjectFileIndex.getInstance(project).isInContent(parent)) return findPusherValuesUpwards(project, parent, pusher); - T projectValue = pusher.getImmediateValue(project, null); - return projectValue != null? projectValue : pusher.getDefaultValue(); + return findPusherValuesFromParent(project, dir, pusher); } private static T findPusherValuesUpwards(Project project, VirtualFile dir, FilePropertyPusher pusher) { @@ -239,6 +236,10 @@ public class PushedFilePropertiesUpdaterImpl extends PushedFilePropertiesUpdater if (userValue != null) return userValue; final T value = pusher.getImmediateValue(project, dir); if (value != null) return value; + return findPusherValuesFromParent(project, dir, pusher); + } + + private static T findPusherValuesFromParent(Project project, VirtualFile dir, FilePropertyPusher pusher) { final VirtualFile parent = dir.getParent(); if (parent != null && ProjectFileIndex.getInstance(project).isInContent(parent)) return findPusherValuesUpwards(project, parent, pusher); T projectValue = pusher.getImmediateValue(project, null);