Skip to content

Commit 9543fcf

Browse files
committed
Upgrade to spring-javaformat 0.0.6
1 parent 17de157 commit 9543fcf

File tree

290 files changed

+1021
-1014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+1021
-1014
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/audit/AuditEvent.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -56,9 +56,9 @@ public class AuditEvent implements Serializable {
5656

5757
/**
5858
* Create a new audit event for the current time.
59-
* @param principal The user principal responsible
59+
* @param principal the user principal responsible
6060
* @param type the event type
61-
* @param data The event data
61+
* @param data the event data
6262
*/
6363
public AuditEvent(String principal, String type, Map<String, Object> data) {
6464
this(new Date(), principal, type, data);
@@ -67,27 +67,27 @@ public AuditEvent(String principal, String type, Map<String, Object> data) {
6767
/**
6868
* Create a new audit event for the current time from data provided as name-value
6969
* pairs.
70-
* @param principal The user principal responsible
70+
* @param principal the user principal responsible
7171
* @param type the event type
72-
* @param data The event data in the form 'key=value' or simply 'key'
72+
* @param data the event data in the form 'key=value' or simply 'key'
7373
*/
7474
public AuditEvent(String principal, String type, String... data) {
7575
this(new Date(), principal, type, convert(data));
7676
}
7777

7878
/**
7979
* Create a new audit event.
80-
* @param timestamp The date/time of the event
81-
* @param principal The user principal responsible
80+
* @param timestamp the date/time of the event
81+
* @param principal the user principal responsible
8282
* @param type the event type
83-
* @param data The event data
83+
* @param data the event data
8484
*/
8585
public AuditEvent(Date timestamp, String principal, String type,
8686
Map<String, Object> data) {
8787
Assert.notNull(timestamp, "Timestamp must not be null");
8888
Assert.notNull(type, "Type must not be null");
8989
this.timestamp = timestamp;
90-
this.principal = (principal != null ? principal : "");
90+
this.principal = (principal != null) ? principal : "";
9191
this.type = type;
9292
this.data = Collections.unmodifiableMap(data);
9393
}

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointAutoConfiguration.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ public EnvironmentEndpoint environmentEndpoint() {
114114
@Bean
115115
@ConditionalOnMissingBean
116116
public HealthEndpoint healthEndpoint() {
117-
HealthAggregator healthAggregator = (this.healthAggregator != null
118-
? this.healthAggregator : new OrderedHealthAggregator());
119-
Map<String, HealthIndicator> healthIndicators = (this.healthIndicators != null
120-
? this.healthIndicators
121-
: Collections.<String, HealthIndicator>emptyMap());
117+
HealthAggregator healthAggregator = (this.healthAggregator != null)
118+
? this.healthAggregator : new OrderedHealthAggregator();
119+
Map<String, HealthIndicator> healthIndicators = (this.healthIndicators != null)
120+
? this.healthIndicators : Collections.<String, HealthIndicator>emptyMap();
122121
return new HealthEndpoint(healthAggregator, healthIndicators);
123122
}
124123

@@ -131,7 +130,7 @@ public BeansEndpoint beansEndpoint() {
131130
@Bean
132131
@ConditionalOnMissingBean
133132
public InfoEndpoint infoEndpoint() throws Exception {
134-
return new InfoEndpoint(this.infoContributors != null ? this.infoContributors
133+
return new InfoEndpoint((this.infoContributors != null) ? this.infoContributors
135134
: Collections.<InfoContributor>emptyList());
136135
}
137136

@@ -156,7 +155,7 @@ public MetricsEndpoint metricsEndpoint() {
156155
@Bean
157156
@ConditionalOnMissingBean
158157
public TraceEndpoint traceEndpoint() {
159-
return new TraceEndpoint(this.traceRepository != null ? this.traceRepository
158+
return new TraceEndpoint((this.traceRepository != null) ? this.traceRepository
160159
: new InMemoryTraceRepository());
161160
}
162161

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -376,8 +376,8 @@ public static ManagementServerPort get(Environment environment,
376376
}
377377
return ((managementPort == null)
378378
|| (serverPort == null && managementPort.equals(8080))
379-
|| (managementPort != 0 && managementPort.equals(serverPort)) ? SAME
380-
: DIFFERENT);
379+
|| (managementPort != 0) && managementPort.equals(serverPort)) ? SAME
380+
: DIFFERENT;
381381
}
382382

383383
private static <T> T getTemporaryBean(BeanFactory beanFactory, Class<T> type) {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private boolean isHypermediaDisabled(MethodParameter returnType) {
340340
private String getPath(ServletServerHttpRequest request) {
341341
String path = (String) request.getServletRequest()
342342
.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
343-
return (path != null ? path : "");
343+
return (path != null) ? path : "";
344344
}
345345

346346
}
@@ -355,8 +355,9 @@ private static class EndpointResource extends ResourceSupport {
355355

356356
@SuppressWarnings("unchecked")
357357
EndpointResource(Object content, String path) {
358-
this.content = (content instanceof Map ? null : content);
359-
this.embedded = (Map<String, Object>) (this.content != null ? null : content);
358+
this.content = (content instanceof Map) ? null : content;
359+
this.embedded = (Map<String, Object>) ((this.content != null) ? null
360+
: content);
360361
add(linkTo(Object.class).slash(path).withSelfRel());
361362
}
362363

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcManagementContextConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public EndpointWebMvcManagementContextConfiguration(
8989
this.corsProperties = corsProperties;
9090
List<EndpointHandlerMappingCustomizer> providedCustomizers = mappingCustomizers
9191
.getIfAvailable();
92-
this.mappingCustomizers = (providedCustomizers != null ? providedCustomizers
93-
: Collections.<EndpointHandlerMappingCustomizer>emptyList());
92+
this.mappingCustomizers = (providedCustomizers != null) ? providedCustomizers
93+
: Collections.<EndpointHandlerMappingCustomizer>emptyList();
9494
}
9595

9696
@Bean

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected DataSourceHealthIndicator createHealthIndicator(DataSource source) {
231231
private String getValidationQuery(DataSource source) {
232232
DataSourcePoolMetadata poolMetadata = this.poolMetadataProvider
233233
.getDataSourcePoolMetadata(source);
234-
return (poolMetadata != null ? poolMetadata.getValidationQuery() : null);
234+
return (poolMetadata != null) ? poolMetadata.getValidationQuery() : null;
235235
}
236236

237237
}

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LinksEnhancer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private String getRel(MvcEndpoint endpoint) {
7474
private void addEndpointLink(ResourceSupport resource, MvcEndpoint endpoint,
7575
String rel) {
7676
Class<?> type = endpoint.getEndpointType();
77-
type = (type != null ? type : Object.class);
77+
type = (type != null) ? type : Object.class;
7878
if (StringUtils.hasText(rel)) {
7979
String href = this.rootPath + endpoint.getPath();
8080
resource.add(linkTo(type).slash(href).withRel(rel));

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementContextConfigurationsImportSelector.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ private static final class ManagementConfiguration implements Ordered {
111111
private int readOrder(AnnotationMetadata annotationMetadata) {
112112
Map<String, Object> attributes = annotationMetadata
113113
.getAnnotationAttributes(Order.class.getName());
114-
Integer order = (attributes != null ? (Integer) attributes.get("value")
115-
: null);
116-
return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
114+
Integer order = (attributes != null) ? (Integer) attributes.get("value")
115+
: null;
116+
return (order != null) ? order : Ordered.LOWEST_PRECEDENCE;
117117
}
118118

119119
public String getClassName() {

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricExportAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public SchedulingConfigurer metricWritersMetricExporter(
9595
exporters.setReader(reader);
9696
exporters.setWriters(writers);
9797
}
98-
exporters.setExporters(this.exporters != null ? this.exporters
98+
exporters.setExporters((this.exporters != null) ? this.exporters
9999
: Collections.<String, Exporter>emptyMap());
100100
return exporters;
101101
}
@@ -128,7 +128,7 @@ protected static class MetricExportPropertiesConfiguration {
128128
public MetricExportProperties metricExportProperties() {
129129
MetricExportProperties export = new MetricExportProperties();
130130
export.getRedis().setPrefix("spring.metrics"
131-
+ (this.prefix.length() > 0 ? "." : "") + this.prefix);
131+
+ ((this.prefix.length() > 0) ? "." : "") + this.prefix);
132132
export.getAggregate().setPrefix(this.prefix);
133133
export.getAggregate().setKeyPattern(this.aggregateKeyPattern);
134134
return export;

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/PublicMetricsAutoConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ public SystemPublicMetrics systemPublicMetrics() {
8989

9090
@Bean
9191
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
92-
MetricReader[] readers = (this.metricReaders != null
92+
MetricReader[] readers = (this.metricReaders != null)
9393
? this.metricReaders.toArray(new MetricReader[this.metricReaders.size()])
94-
: new MetricReader[0]);
94+
: new MetricReader[0];
9595
return new MetricReaderPublicMetrics(new CompositeMetricReader(readers));
9696
}
9797

0 commit comments

Comments
 (0)