Formatting

pull/13087/head
Phillip Webb 7 years ago
parent 1314aaa368
commit 0a0247975c

@ -344,6 +344,7 @@ public class ConfigurationPropertiesReportEndpoint
} }
super.serializeAsField(pojo, jgen, provider, writer); super.serializeAsField(pojo, jgen, provider, writer);
} }
} }
/** /**
@ -395,4 +396,5 @@ public class ConfigurationPropertiesReportEndpoint
} }
} }
} }

@ -104,8 +104,8 @@ public class DataSourcePublicMetrics implements PublicMetrics {
if (primary) { if (primary) {
return "datasource.primary"; return "datasource.primary";
} }
if (name.length() > DATASOURCE_SUFFIX.length() if (name.length() > DATASOURCE_SUFFIX.length() && name.toLowerCase(Locale.ENGLISH)
&& name.toLowerCase(Locale.ENGLISH).endsWith(DATASOURCE_SUFFIX.toLowerCase())) { .endsWith(DATASOURCE_SUFFIX.toLowerCase())) {
name = name.substring(0, name.length() - DATASOURCE_SUFFIX.length()); name = name.substring(0, name.length() - DATASOURCE_SUFFIX.length());
} }
return "datasource." + name; return "datasource." + name;

@ -73,6 +73,7 @@ public class FlywayEndpoint extends AbstractEndpoint<List<FlywayReport>> {
public static class FlywayReport { public static class FlywayReport {
private final String name; private final String name;
private final List<FlywayMigration> migrations; private final List<FlywayMigration> migrations;
public FlywayReport(String name, List<FlywayMigration> migrations) { public FlywayReport(String name, List<FlywayMigration> migrations) {

@ -142,6 +142,7 @@ public class MvcEndpointSecurityInterceptor extends HandlerInterceptorAdapter {
} }
return false; return false;
} }
} }
} }

@ -325,6 +325,7 @@ public class EndpointWebMvcManagementContextConfigurationTests {
TestMetricsMvcEndpoint(MetricsEndpoint delegate) { TestMetricsMvcEndpoint(MetricsEndpoint delegate) {
super(delegate); super(delegate);
} }
} }
static class TestAuditEventsMvcEndpoint extends AuditEventsMvcEndpoint { static class TestAuditEventsMvcEndpoint extends AuditEventsMvcEndpoint {
@ -332,6 +333,7 @@ public class EndpointWebMvcManagementContextConfigurationTests {
TestAuditEventsMvcEndpoint(AuditEventRepository auditEventRepository) { TestAuditEventsMvcEndpoint(AuditEventRepository auditEventRepository) {
super(auditEventRepository); super(auditEventRepository);
} }
} }
static class TestShutdownMvcEndpoint extends ShutdownMvcEndpoint { static class TestShutdownMvcEndpoint extends ShutdownMvcEndpoint {
@ -339,6 +341,7 @@ public class EndpointWebMvcManagementContextConfigurationTests {
TestShutdownMvcEndpoint(ShutdownEndpoint delegate) { TestShutdownMvcEndpoint(ShutdownEndpoint delegate) {
super(delegate); super(delegate);
} }
} }
} }

@ -277,4 +277,5 @@ public class HealthMvcEndpointTests {
Health health = ((ResponseEntity<Health>) result).getBody(); Health health = ((ResponseEntity<Health>) result).getBody();
assertThat(health.getStatus() == Status.DOWN).isTrue(); assertThat(health.getStatus() == Status.DOWN).isTrue();
} }
} }

@ -75,8 +75,7 @@ public class CacheAutoConfiguration {
@Bean @Bean
public CacheManagerValidator cacheAutoConfigurationValidator( public CacheManagerValidator cacheAutoConfigurationValidator(
CacheProperties cacheProperties, CacheProperties cacheProperties, ObjectProvider<CacheManager> cacheManager) {
ObjectProvider<CacheManager> cacheManager) {
return new CacheManagerValidator(cacheProperties, cacheManager); return new CacheManagerValidator(cacheProperties, cacheManager);
} }

@ -115,8 +115,8 @@ public class CassandraDataAutoConfiguration {
session.setKeyspaceName(this.properties.getKeyspaceName()); session.setKeyspaceName(this.properties.getKeyspaceName());
String name = this.propertyResolver.getProperty("schemaAction", String name = this.propertyResolver.getProperty("schemaAction",
SchemaAction.NONE.name()); SchemaAction.NONE.name());
SchemaAction schemaAction = SchemaAction.valueOf( SchemaAction schemaAction = SchemaAction
name.toUpperCase(Locale.ENGLISH)); .valueOf(name.toUpperCase(Locale.ENGLISH));
session.setSchemaAction(schemaAction); session.setSchemaAction(schemaAction);
return session; return session;
} }

@ -120,6 +120,7 @@ public class IntegrationAutoConfiguration {
@Configuration @Configuration
@EnableIntegrationManagement(defaultCountsEnabled = "true", defaultStatsEnabled = "true") @EnableIntegrationManagement(defaultCountsEnabled = "true", defaultStatsEnabled = "true")
protected static class EnableIntegrationManagementConfiguration { protected static class EnableIntegrationManagementConfiguration {
} }
} }

@ -77,6 +77,7 @@ class IntegrationAutoConfigurationScanRegistrar extends IntegrationComponentScan
} }
return attributes; return attributes;
} }
} }
@IntegrationComponentScan @IntegrationComponentScan

@ -185,6 +185,7 @@ public class OAuth2RestOperationsConfiguration {
@Conditional(ClientCredentialsCondition.class) @Conditional(ClientCredentialsCondition.class)
static class ClientCredentialsActivated { static class ClientCredentialsActivated {
} }
} }
@ -200,10 +201,12 @@ public class OAuth2RestOperationsConfiguration {
@ConditionalOnProperty(prefix = "security.oauth2.client", name = "grant-type", havingValue = "client_credentials", matchIfMissing = false) @ConditionalOnProperty(prefix = "security.oauth2.client", name = "grant-type", havingValue = "client_credentials", matchIfMissing = false)
static class ClientCredentialsConfigured { static class ClientCredentialsConfigured {
} }
@ConditionalOnNotWebApplication @ConditionalOnNotWebApplication
static class NoWebApplication { static class NoWebApplication {
} }
} }

@ -292,6 +292,7 @@ public class ResourceServerProperties implements Validator, BeanFactoryAware {
public void setKeySetUri(String keySetUri) { public void setKeySetUri(String keySetUri) {
this.keySetUri = keySetUri; this.keySetUri = keySetUri;
} }
} }
} }

@ -234,6 +234,7 @@ public class ResourceServerTokenServicesConfiguration {
public TokenStore jwkTokenStore() { public TokenStore jwkTokenStore() {
return new JwkTokenStore(this.resource.getJwk().getKeySetUri()); return new JwkTokenStore(this.resource.getJwk().getKeySetUri());
} }
} }
@Configuration @Configuration
@ -415,6 +416,7 @@ public class ResourceServerTokenServicesConfiguration {
static class HasJwkConfiguration { static class HasJwkConfiguration {
} }
} }
static class AcceptJsonRequestInterceptor implements ClientHttpRequestInterceptor { static class AcceptJsonRequestInterceptor implements ClientHttpRequestInterceptor {

@ -75,6 +75,7 @@ public class TransactionAutoConfiguration {
public TransactionTemplate transactionTemplate() { public TransactionTemplate transactionTemplate() {
return new TransactionTemplate(this.transactionManager); return new TransactionTemplate(this.transactionManager);
} }
} }
@Configuration @Configuration

@ -776,8 +776,8 @@ public class CacheAutoConfigurationTests {
public void autoConfiguredCacheManagerCanBeSwapped() { public void autoConfiguredCacheManagerCanBeSwapped() {
load(CacheManagerPostProcessorConfiguration.class, "spring.cache.type=caffeine"); load(CacheManagerPostProcessorConfiguration.class, "spring.cache.type=caffeine");
validateCacheManager(SimpleCacheManager.class); validateCacheManager(SimpleCacheManager.class);
CacheManagerPostProcessor postProcessor = this.context.getBean( CacheManagerPostProcessor postProcessor = this.context
CacheManagerPostProcessor.class); .getBean(CacheManagerPostProcessor.class);
assertThat(postProcessor.cacheManagers).hasSize(1); assertThat(postProcessor.cacheManagers).hasSize(1);
assertThat(postProcessor.cacheManagers.get(0)) assertThat(postProcessor.cacheManagers.get(0))
.isInstanceOf(CaffeineCacheManager.class); .isInstanceOf(CaffeineCacheManager.class);
@ -1193,14 +1193,14 @@ public class CacheAutoConfigurationTests {
private final List<CacheManager> cacheManagers = new ArrayList<CacheManager>(); private final List<CacheManager> cacheManagers = new ArrayList<CacheManager>();
@Override @Override
public Object postProcessBeforeInitialization(Object bean, public Object postProcessBeforeInitialization(Object bean, String beanName)
String beanName) throws BeansException { throws BeansException {
return bean; return bean;
} }
@Override @Override
public Object postProcessAfterInitialization(Object bean, public Object postProcessAfterInitialization(Object bean, String beanName)
String beanName) throws BeansException { throws BeansException {
if (bean instanceof CacheManager) { if (bean instanceof CacheManager) {
this.cacheManagers.add((CacheManager) bean); this.cacheManagers.add((CacheManager) bean);
return new SimpleCacheManager(); return new SimpleCacheManager();

@ -185,6 +185,7 @@ public class CouchbaseDataAutoConfigurationTests {
public Boolean convert(CouchbaseProperties value) { public Boolean convert(CouchbaseProperties value) {
return true; return true;
} }
} }
} }

@ -203,6 +203,7 @@ public class TransactionAutoConfigurationTests {
public AnotherServiceImpl anotherService() { public AnotherServiceImpl anotherService() {
return new AnotherServiceImpl(); return new AnotherServiceImpl();
} }
} }
@Configuration @Configuration

@ -304,6 +304,7 @@ public class ValidationAutoConfigurationTests {
interface AnotherSampleService { interface AnotherSampleService {
void doSomething(@Min(42) Integer counter); void doSomething(@Min(42) Integer counter);
} }
@Validated @Validated
@ -313,6 +314,7 @@ public class ValidationAutoConfigurationTests {
public void doSomething(Integer counter) { public void doSomething(Integer counter) {
} }
} }
@Configuration @Configuration
@ -382,6 +384,7 @@ public class ValidationAutoConfigurationTests {
} }
} }
} }
} }

@ -131,9 +131,10 @@ abstract class ArchiveCommand extends OptionParsingCommand {
File output = new File((String) nonOptionArguments.remove(0)); File output = new File((String) nonOptionArguments.remove(0));
Assert.isTrue( Assert.isTrue(
output.getName().toLowerCase(Locale.ENGLISH).endsWith("." + this.type), output.getName().toLowerCase(Locale.ENGLISH)
"The output '" + output + "' is not a " + this.type.toUpperCase( .endsWith("." + this.type),
Locale.ENGLISH) + " file."); "The output '" + output + "' is not a "
+ this.type.toUpperCase(Locale.ENGLISH) + " file.");
deleteIfExists(output); deleteIfExists(output);
GroovyCompiler compiler = createCompiler(options); GroovyCompiler compiler = createCompiler(options);

@ -360,7 +360,8 @@ class ProjectGenerationRequest {
return builder.build(); return builder.build();
} }
catch (URISyntaxException ex) { catch (URISyntaxException ex) {
throw new ReportableException("Invalid service URL (" + ex.getMessage() + ")"); throw new ReportableException(
"Invalid service URL (" + ex.getMessage() + ")");
} }
} }

@ -42,4 +42,5 @@ public class JestClientCustomizationExample {
} }
// end::customizer[] // end::customizer[]
} }

@ -55,9 +55,7 @@ public class SampleWebClientTests {
@Bean @Bean
public RestTemplateBuilder restTemplateBuilder() { public RestTemplateBuilder restTemplateBuilder() {
return new RestTemplateBuilder() return new RestTemplateBuilder().setConnectTimeout(1000).setReadTimeout(1000);
.setConnectTimeout(1000)
.setReadTimeout(1000);
} }
} }

@ -354,6 +354,7 @@ class ImportsContextCustomizer implements ContextCustomizer {
public String toString() { public String toString() {
return this.key.toString(); return this.key.toString();
} }
} }
/** /**

@ -30,4 +30,5 @@ public class TestMethodConfiguration {
public Object method() { public Object method() {
return null; return null;
} }
} }

@ -29,4 +29,5 @@ import java.io.OutputStream;
@TestConditionalOnClass(name = "java.io.InputStream", value = OutputStream.class) @TestConditionalOnClass(name = "java.io.InputStream", value = OutputStream.class)
@TestAutoConfigureOrder(123) @TestAutoConfigureOrder(123)
public class TestOrderedClassConfiguration { public class TestOrderedClassConfiguration {
} }

@ -549,8 +549,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
"java.lang.String", null, null, null, null, null); "java.lang.String", null, null, null, null, null);
writeAdditionalMetadata(property); writeAdditionalMetadata(property);
ConfigurationMetadata metadata = compile(SimpleProperties.class); ConfigurationMetadata metadata = compile(SimpleProperties.class);
assertThat(metadata).has(Metadata.withGroup("simple") assertThat(metadata)
.fromSource(SimpleProperties.class)); .has(Metadata.withGroup("simple").fromSource(SimpleProperties.class));
assertThat(metadata).has(Metadata.withProperty("simple", String.class)); assertThat(metadata).has(Metadata.withProperty("simple", String.class));
} }

@ -160,6 +160,7 @@ public final class Layouts {
/** /**
* Module layout (designed to be used as a "plug-in"). * Module layout (designed to be used as a "plug-in").
*
* @deprecated as of 1.5 in favor of a custom {@link LayoutFactory} * @deprecated as of 1.5 in favor of a custom {@link LayoutFactory}
*/ */
@Deprecated @Deprecated

@ -108,7 +108,7 @@ public class JarFile extends java.util.jar.JarFile {
private JarFile(RandomAccessDataFile rootFile, String pathFromRoot, private JarFile(RandomAccessDataFile rootFile, String pathFromRoot,
RandomAccessData data, JarEntryFilter filter, JarFileType type) RandomAccessData data, JarEntryFilter filter, JarFileType type)
throws IOException { throws IOException {
super(rootFile.getFile()); super(rootFile.getFile());
this.rootFile = rootFile; this.rootFile = rootFile;
this.pathFromRoot = pathFromRoot; this.pathFromRoot = pathFromRoot;

@ -54,8 +54,8 @@ import org.springframework.validation.Validator;
* @param <T> the target type * @param <T> the target type
* @author Dave Syer * @author Dave Syer
*/ */
public class PropertiesConfigurationFactory<T> public class PropertiesConfigurationFactory<T> implements FactoryBean<T>,
implements FactoryBean<T>, ApplicationContextAware, MessageSourceAware, InitializingBean { ApplicationContextAware, MessageSourceAware, InitializingBean {
private static final char[] EXACT_DELIMITERS = { '_', '.', '[' }; private static final char[] EXACT_DELIMITERS = { '_', '.', '[' };

@ -42,8 +42,8 @@ public class AnsiOutputApplicationListener
event.getEnvironment(), "spring.output.ansi."); event.getEnvironment(), "spring.output.ansi.");
if (resolver.containsProperty("enabled")) { if (resolver.containsProperty("enabled")) {
String enabled = resolver.getProperty("enabled"); String enabled = resolver.getProperty("enabled");
AnsiOutput.setEnabled(Enum.valueOf(Enabled.class, AnsiOutput.setEnabled(
enabled.toUpperCase(Locale.ENGLISH))); Enum.valueOf(Enabled.class, enabled.toUpperCase(Locale.ENGLISH)));
} }
if (resolver.containsProperty("console-available")) { if (resolver.containsProperty("console-available")) {

@ -130,7 +130,6 @@ public abstract class AbstractEmbeddedServletContainerFactory
/** /**
* Converts the given {@code url} into a decoded file path. * Converts the given {@code url} into a decoded file path.
*
* @param url the url to convert * @param url the url to convert
* @return the file path * @return the file path
* @deprecated Since 1.5.13 in favor of {@link File#File(java.net.URI)} * @deprecated Since 1.5.13 in favor of {@link File#File(java.net.URI)}

@ -102,7 +102,6 @@ import org.springframework.util.StringUtils;
* @author Venil Noronha * @author Venil Noronha
* @author Henri Kerola * @author Henri Kerola
* @author Henrich Krämer * @author Henrich Krämer
*
* @see #setPort(int) * @see #setPort(int)
* @see #setConfigurations(Collection) * @see #setConfigurations(Collection)
* @see JettyEmbeddedServletContainer * @see JettyEmbeddedServletContainer

@ -701,6 +701,7 @@ public class UndertowEmbeddedServletContainerFactory
return null; return null;
} }
} }
} }
/** /**
@ -722,6 +723,7 @@ public class UndertowEmbeddedServletContainerFactory
initializer.onStartup(servletContext); initializer.onStartup(servletContext);
} }
} }
} }
/** /**

@ -112,6 +112,7 @@ public class Jetty8JettyEmbeddedServletContainerFactoryTests {
resp.getWriter().print("An error occurred"); resp.getWriter().print("An error occurred");
resp.flushBuffer(); resp.flushBuffer();
} }
} }
} }

@ -554,6 +554,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests {
interface ValidatedProperties { interface ValidatedProperties {
String getFoo(); String getFoo();
} }
@ConfigurationProperties("test") @ConfigurationProperties("test")
@ -890,6 +891,7 @@ public class ConfigurationPropertiesBindingPostProcessorTests {
} }
return null; return null;
} }
} }
} }

@ -117,5 +117,7 @@ public class JsonComponentModuleTests {
static class ConcreteSerializer extends AbstractSerializer { static class ConcreteSerializer extends AbstractSerializer {
} }
} }
} }

Loading…
Cancel
Save