mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
findPusherValuesFromParent extracted
This commit is contained in:
+5
-4
@@ -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> T findPusherValuesUpwards(Project project, VirtualFile dir, FilePropertyPusher<T> 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> T findPusherValuesFromParent(Project project, VirtualFile dir, FilePropertyPusher<T> 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);
|
||||
|
||||
Reference in New Issue
Block a user