aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/setting/ws/Setting.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/setting/ws/SettingsFinder.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/setting/ws/ValuesAction.java5
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml1
4 files changed, 8 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());
}
diff --git a/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml b/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml
index d1fbc569e55..6656440da63 100644
--- a/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/property/PropertiesMapper.xml
@@ -130,6 +130,7 @@
and p.resource_id=#{componentId}
</if>
and p.user_id is null
+ order by p.id
</select>
<select id="selectByKeysAndComponentIds" parameterType="map" resultType="ScrapProperty">