Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class AutoConfiguredHealthEndpointGroups implements HealthEndpointGroups {
private Map<String, HealthEndpointGroup> createGroups(Map<String, Group> groupProperties, BeanFactory beanFactory,
StatusAggregator defaultStatusAggregator, HttpCodeStatusMapper defaultHttpCodeStatusMapper,
Show defaultShowComponents, Show defaultShowDetails, Set<String> defaultRoles) {
Map<String, HealthEndpointGroup> groups = new LinkedHashMap<String, HealthEndpointGroup>();
Map<String, HealthEndpointGroup> groups = new LinkedHashMap<>();
groupProperties.forEach((groupName, group) -> {
Status status = group.getStatus();
Show showComponents = (group.getShowComponents() != null) ? group.getShowComponents()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HealthAggregatorStatusAggregatorAdapter implements StatusAggregator {
@Override
public Status getAggregateStatus(Set<Status> statuses) {
int index = 0;
Map<String, Health> healths = new LinkedHashMap<String, Health>();
Map<String, Health> healths = new LinkedHashMap<>();
for (Status status : statuses) {
index++;
healths.put("health" + index, asHealth(status));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public HealthIndicator get(String name) {

@Override
public Map<String, HealthIndicator> getAll() {
Map<String, HealthIndicator> all = new LinkedHashMap<String, HealthIndicator>();
Map<String, HealthIndicator> all = new LinkedHashMap<>();
for (NamedContributor<?> namedContributor : this.contributorRegistry) {
if (namedContributor.getContributor() instanceof HealthIndicator) {
all.put(namedContributor.getName(), (HealthIndicator) namedContributor.getContributor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class HealthIndicatorProperties {

private List<String> order = new ArrayList<>();

private final Map<String, Integer> httpMapping = new LinkedHashMap<String, Integer>();
private final Map<String, Integer> httpMapping = new LinkedHashMap<>();

@DeprecatedConfigurationProperty(replacement = "management.endpoint.health.status.order")
public List<String> getOrder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private HealthResult<T> getHealth(ApiVersion apiVersion, HealthEndpointGroup gro
Object contributor = getContributor(path, pathOffset);
T health = getContribution(apiVersion, group, contributor, showComponents, showDetails,
isSystemHealth ? this.groups.getNames() : null);
return (health != null) ? new HealthResult<T>(health, group) : null;
return (health != null) ? new HealthResult<>(health, group) : null;
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public int getStatusCode(Status status) {
}

private static Map<String, Integer> getUniformMappings(Map<String, Integer> mappings) {
Map<String, Integer> result = new LinkedHashMap<String, Integer>();
Map<String, Integer> result = new LinkedHashMap<>();
for (Map.Entry<String, Integer> entry : mappings.entrySet()) {
String code = getUniformCode(entry.getKey());
if (code != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class SimpleStatusAggregator implements StatusAggregator {

private static final List<String> DEFAULT_ORDER;
static {
List<String> defaultOrder = new ArrayList<String>();
List<String> defaultOrder = new ArrayList<>();
defaultOrder.add(Status.DOWN.getCode());
defaultOrder.add(Status.OUT_OF_SERVICE.getCode());
defaultOrder.add(Status.UP.getCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ HealthContributorRegistry healthContributorRegistry(Map<String, HealthContributo
ReactiveHealthContributorRegistry reactiveHealthContributorRegistry(
Map<String, HealthContributor> healthContributorBeans,
Map<String, ReactiveHealthContributor> reactiveHealthContributorBeans) {
Map<String, ReactiveHealthContributor> allIndicators = new LinkedHashMap<String, ReactiveHealthContributor>(
reactiveHealthContributorBeans);
Map<String, ReactiveHealthContributor> allIndicators = new LinkedHashMap<>(reactiveHealthContributorBeans);
healthContributorBeans.forEach((name, contributor) -> allIndicators.computeIfAbsent(name,
(key) -> ReactiveHealthContributor.adapt(contributor)));
return new DefaultReactiveHealthContributorRegistry(allIndicators);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void getContributorWhenNotInMapReturnsNull() {
}

private TestNamedContributorsMapAdapter<String> createAdapter() {
Map<String, String> map = new LinkedHashMap<String, String>();
Map<String, String> map = new LinkedHashMap<>();
map.put("one", "one");
map.put("two", "two");
TestNamedContributorsMapAdapter<String> adapter = new TestNamedContributorsMapAdapter<>(map, this::reverse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse re
public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
HttpStatus status = getStatus(request);
if (status == HttpStatus.NO_CONTENT) {
return new ResponseEntity<Map<String, Object>>(status);
return new ResponseEntity<>(status);
}
Map<String, Object> body = getErrorAttributes(request, isIncludeStackTrace(request, MediaType.ALL));
return new ResponseEntity<>(body, status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public <E extends Enum<?>> Converter<T, E> getConverter(Class<E> targetType) {
enumType = enumType.getSuperclass();
}
Assert.notNull(enumType, () -> "The target type " + targetType.getName() + " does not refer to an enum");
return new LenientToEnumConverter<E>((Class<E>) enumType);
return new LenientToEnumConverter<>((Class<E>) enumType);
}

@SuppressWarnings("unchecked")
Expand Down