Upgrade to spring-javaformat 0.0.11
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,8 +39,7 @@ public class ExitCodeApplication {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.exit(SpringApplication
|
||||
.exit(SpringApplication.run(ExitCodeApplication.class, args)));
|
||||
System.exit(SpringApplication.exit(SpringApplication.run(ExitCodeApplication.class, args)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,8 +37,7 @@ public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor
|
||||
private final YamlPropertySourceLoader loader = new YamlPropertySourceLoader();
|
||||
|
||||
@Override
|
||||
public void postProcessEnvironment(ConfigurableEnvironment environment,
|
||||
SpringApplication application) {
|
||||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
||||
Resource path = new ClassPathResource("com/example/myapp/config.yml");
|
||||
PropertySource<?> propertySource = loadYaml(path);
|
||||
environment.getPropertySources().addLast(propertySource);
|
||||
@@ -52,8 +51,7 @@ public class EnvironmentPostProcessorExample implements EnvironmentPostProcessor
|
||||
return this.loader.load("custom-resource", path, null);
|
||||
}
|
||||
catch (IOException ex) {
|
||||
throw new IllegalStateException(
|
||||
"Failed to load yaml configuration from " + path, ex);
|
||||
throw new IllegalStateException("Failed to load yaml configuration from " + path, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,8 +51,7 @@ public class TomcatLegacyCookieProcessorExample {
|
||||
|
||||
@Override
|
||||
public void customize(Context context) {
|
||||
context.setCookieProcessor(
|
||||
new LegacyCookieProcessor());
|
||||
context.setCookieProcessor(new LegacyCookieProcessor());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,8 +35,7 @@ public class HibernateSearchElasticsearchExample {
|
||||
* {@link EntityManagerFactory} beans depend on the {@code elasticsearchClient} bean.
|
||||
*/
|
||||
@Configuration
|
||||
static class ElasticsearchJpaDependencyConfiguration
|
||||
extends EntityManagerFactoryDependsOnPostProcessor {
|
||||
static class ElasticsearchJpaDependencyConfiguration extends EntityManagerFactoryDependsOnPostProcessor {
|
||||
|
||||
ElasticsearchJpaDependencyConfiguration() {
|
||||
super("elasticsearchClient");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -51,8 +51,7 @@ public class ConfigurableDataSourceExample {
|
||||
@Bean
|
||||
@ConfigurationProperties("app.datasource")
|
||||
public HikariDataSource dataSource(DataSourceProperties properties) {
|
||||
return (HikariDataSource) properties.initializeDataSourceBuilder()
|
||||
.type(HikariDataSource.class).build();
|
||||
return (HikariDataSource) properties.initializeDataSourceBuilder().type(HikariDataSource.class).build();
|
||||
}
|
||||
// end::configuration[]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,8 +42,7 @@ public class SimpleDataSourceExample {
|
||||
@Bean
|
||||
@ConfigurationProperties("app.datasource")
|
||||
public HikariDataSource dataSource() {
|
||||
return (HikariDataSource) DataSourceBuilder.create()
|
||||
.type(HikariDataSource.class).build();
|
||||
return (HikariDataSource) DataSourceBuilder.create().type(HikariDataSource.class).build();
|
||||
}
|
||||
// end::configuration[]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -59,8 +59,7 @@ public class SimpleTwoDataSourcesExample {
|
||||
@Bean
|
||||
@ConfigurationProperties("app.datasource.bar")
|
||||
public BasicDataSource barDataSource() {
|
||||
return (BasicDataSource) DataSourceBuilder.create()
|
||||
.type(BasicDataSource.class).build();
|
||||
return (BasicDataSource) DataSourceBuilder.create().type(BasicDataSource.class).build();
|
||||
}
|
||||
// end::configuration[]
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,8 +39,7 @@ public class JerseySetStatusOverSendErrorExample {
|
||||
|
||||
public JerseyConfig() {
|
||||
register(Endpoint.class);
|
||||
setProperties(Collections.singletonMap(
|
||||
"jersey.config.server.response.setStatusOverSendError", true));
|
||||
setProperties(Collections.singletonMap("jersey.config.server.response.setStatusOverSendError", true));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2017 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,8 +52,7 @@ public class KafkaSpecialProducerConsumerConfigExample {
|
||||
@Bean
|
||||
public ProducerFactory<?, ?> kafkaProducerFactory(KafkaProperties properties) {
|
||||
Map<String, Object> producerProperties = properties.buildProducerProperties();
|
||||
producerProperties.put(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG,
|
||||
MyProducerMetricsReporter.class);
|
||||
producerProperties.put(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG, MyProducerMetricsReporter.class);
|
||||
return new DefaultKafkaProducerFactory<Object, Object>(producerProperties);
|
||||
}
|
||||
|
||||
@@ -65,8 +64,7 @@ public class KafkaSpecialProducerConsumerConfigExample {
|
||||
@Bean
|
||||
public ConsumerFactory<?, ?> kafkaConsumerFactory(KafkaProperties properties) {
|
||||
Map<String, Object> consumerProperties = properties.buildConsumerProperties();
|
||||
consumerProperties.put(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG,
|
||||
MyConsumerMetricsReporter.class);
|
||||
consumerProperties.put(CommonClientConfigs.METRIC_REPORTER_CLASSES_CONFIG, MyConsumerMetricsReporter.class);
|
||||
return new DefaultKafkaConsumerFactory<Object, Object>(consumerProperties);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* * Copyright 2012-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,22 +44,19 @@ public class RestTemplateProxyCustomizationExample {
|
||||
@Override
|
||||
public void customize(RestTemplate restTemplate) {
|
||||
HttpHost proxy = new HttpHost("proxy.example.com");
|
||||
HttpClient httpClient = HttpClientBuilder.create()
|
||||
.setRoutePlanner(new DefaultProxyRoutePlanner(proxy) {
|
||||
HttpClient httpClient = HttpClientBuilder.create().setRoutePlanner(new DefaultProxyRoutePlanner(proxy) {
|
||||
|
||||
@Override
|
||||
public HttpHost determineProxy(HttpHost target,
|
||||
HttpRequest request, HttpContext context)
|
||||
throws HttpException {
|
||||
if (target.getHostName().equals("192.168.0.5")) {
|
||||
return null;
|
||||
}
|
||||
return super.determineProxy(target, request, context);
|
||||
}
|
||||
@Override
|
||||
public HttpHost determineProxy(HttpHost target, HttpRequest request, HttpContext context)
|
||||
throws HttpException {
|
||||
if (target.getHostName().equals("192.168.0.5")) {
|
||||
return null;
|
||||
}
|
||||
return super.determineProxy(target, request, context);
|
||||
}
|
||||
|
||||
}).build();
|
||||
restTemplate.setRequestFactory(
|
||||
new HttpComponentsClientHttpRequestFactory(httpClient));
|
||||
}).build();
|
||||
restTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory(httpClient));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user