diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-11-16 16:05:05 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-11-16 16:45:31 +0100 |
commit | ce59355081e759025cd0426ac8e315c603c2272b (patch) | |
tree | 0c707e1cb0f07cbb041dafd9fc2b14717dab6a7a /server | |
parent | 5e09c80b98511948c5c261181deaab035f627bc6 (diff) | |
download | sonarqube-ce59355081e759025cd0426ac8e315c603c2272b.tar.gz sonarqube-ce59355081e759025cd0426ac8e315c603c2272b.zip |
SONAR-8389 Property set settings order should be kept
Diffstat (limited to 'server')
3 files changed, 7 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/Setting.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/Setting.java index aa01116f7de..7260b1ce55b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/Setting.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/Setting.java @@ -60,11 +60,11 @@ public class Setting { this.isDefault = true; } - public static Setting createForDto(PropertyDto propertyDto, List<PropertyDto> propertyDtoSetValues, @Nullable PropertyDefinition definition){ + public static Setting createFromDto(PropertyDto propertyDto, List<PropertyDto> propertyDtoSetValues, @Nullable PropertyDefinition definition){ return new Setting(propertyDto, propertyDtoSetValues, definition); } - public static Setting createForDefinition(PropertyDefinition definition){ + public static Setting createFromDefinition(PropertyDefinition definition){ return new Setting(definition); } diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SettingsFinder.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SettingsFinder.java index 7f8dab875b3..89ad946d437 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SettingsFinder.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SettingsFinder.java @@ -55,7 +55,7 @@ public class SettingsFinder { List<PropertyDto> properties = dbClient.propertiesDao().selectGlobalPropertiesByKeys(dbSession, keys); List<PropertyDto> propertySets = dbClient.propertiesDao().selectGlobalPropertiesByKeys(dbSession, getPropertySetKeys(properties)); return properties.stream() - .map(property -> Setting.createForDto(property, getPropertySets(property.getKey(), propertySets, null), definitions.get(property.getKey()))) + .map(property -> Setting.createFromDto(property, getPropertySets(property.getKey(), propertySets, null), definitions.get(property.getKey()))) .collect(Collectors.toList()); } @@ -76,7 +76,7 @@ public class SettingsFinder { String componentUuid = uuidsById.get(componentId); String propertyKey = propertyDto.getKey(); settingsByUuid.put(componentUuid, - Setting.createForDto(propertyDto, getPropertySets(propertyKey, propertySets, componentId), definitions.get(propertyKey))); + Setting.createFromDto(propertyDto, getPropertySets(propertyKey, propertySets, componentId), definitions.get(propertyKey))); } return settingsByUuid; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java index 4388c04c97e..024383dd489 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java @@ -111,7 +111,8 @@ public class ValuesAction implements SettingsWsAction { checkAdminPermission(component); Set<String> keys = new HashSet<>(valuesRequest.getKeys()); Map<String, String> keysToDisplayMap = getKeysToDisplayMap(keys); - return new ValuesResponseBuilder(loadSettings(dbSession, component, keysToDisplayMap.keySet()), component, keysToDisplayMap).build(); + List<Setting> settings = loadSettings(dbSession, component, keysToDisplayMap.keySet()); + return new ValuesResponseBuilder(settings, component, keysToDisplayMap).build(); } finally { dbClient.closeSession(dbSession); } @@ -157,7 +158,7 @@ public class ValuesAction implements SettingsWsAction { return propertyDefinitions.getAll().stream() .filter(definition -> keys.contains(definition.key())) .filter(defaultProperty -> !isEmpty(defaultProperty.defaultValue())) - .map(Setting::createForDefinition) + .map(Setting::createFromDefinition) .collect(Collectors.toList()); } |