Clean up and format code
This commit is contained in:
parent
5d69318e2d
commit
59122358d3
|
|
@ -216,8 +216,8 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
|
|||
ApplicationContext applicationContext) {
|
||||
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
|
||||
if (applicationContext instanceof DefaultResourceLoader) {
|
||||
Collection<ProtocolResolver> protocolResolvers =
|
||||
((DefaultResourceLoader) applicationContext).getProtocolResolvers();
|
||||
Collection<ProtocolResolver> protocolResolvers = ((DefaultResourceLoader) applicationContext)
|
||||
.getProtocolResolvers();
|
||||
for (ProtocolResolver protocolResolver : protocolResolvers) {
|
||||
resourceLoader.addProtocolResolver(protocolResolver);
|
||||
}
|
||||
|
|
@ -247,11 +247,11 @@ final class ClassLoaderFilesResourcePatternResolver implements ResourcePatternRe
|
|||
|
||||
private ResourceLoader createResourceLoader(
|
||||
WebApplicationContext applicationContext) {
|
||||
WebApplicationContextResourceLoader resourceLoader =
|
||||
new WebApplicationContextResourceLoader(applicationContext);
|
||||
WebApplicationContextResourceLoader resourceLoader = new WebApplicationContextResourceLoader(
|
||||
applicationContext);
|
||||
if (applicationContext instanceof DefaultResourceLoader) {
|
||||
Collection<ProtocolResolver> protocolResolvers =
|
||||
((DefaultResourceLoader) applicationContext).getProtocolResolvers();
|
||||
Collection<ProtocolResolver> protocolResolvers = ((DefaultResourceLoader) applicationContext)
|
||||
.getProtocolResolvers();
|
||||
for (ProtocolResolver protocolResolver : protocolResolvers) {
|
||||
resourceLoader.addProtocolResolver(protocolResolver);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,8 +168,7 @@ public class ClassLoaderFilesResourcePatternResolverTests {
|
|||
|
||||
private ProtocolResolver mockProtocolResolver(String path, Resource resource) {
|
||||
ProtocolResolver resolver = mock(ProtocolResolver.class);
|
||||
given(resolver.resolve(eq(path), any(ResourceLoader.class)))
|
||||
.willReturn(resource);
|
||||
given(resolver.resolve(eq(path), any(ResourceLoader.class))).willReturn(resource);
|
||||
return resolver;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ public class Author extends TableImpl<Record> {
|
|||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Author rename(String name) {
|
||||
return new Author(name, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ public class Book extends TableImpl<Record> {
|
|||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Book rename(String name) {
|
||||
return new Book(name, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ public class BookStore extends TableImpl<Record> {
|
|||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public BookStore rename(String name) {
|
||||
return new BookStore(name, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ public class BookToBookStore extends TableImpl<Record> {
|
|||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public BookToBookStore rename(String name) {
|
||||
return new BookToBookStore(name, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ public class Language extends TableImpl<Record> {
|
|||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Language rename(String name) {
|
||||
return new Language(name, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import samples.websocket.jetty93.SampleJetty93WebSocketsApplication;
|
||||
import samples.websocket.jetty93.client.GreetingService;
|
||||
import samples.websocket.jetty93.client.SimpleClientWebSocketHandler;
|
||||
import samples.websocket.jetty93.client.SimpleGreetingService;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
* Copyright 2012-2017 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.
|
||||
|
|
@ -19,8 +19,6 @@ package samples.websocket.jetty93.snake;
|
|||
import java.io.IOException;
|
||||
|
||||
import org.junit.Test;
|
||||
import samples.websocket.jetty93.snake.Snake;
|
||||
import samples.websocket.jetty93.snake.SnakeTimer;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.BDDMockito.willThrow;
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ public class TestDatabaseAutoConfigurationTests {
|
|||
this.context = doLoad(config, environment);
|
||||
}
|
||||
|
||||
private ConfigurableApplicationContext doLoad(Class<?> config, String... environment) {
|
||||
private ConfigurableApplicationContext doLoad(Class<?> config,
|
||||
String... environment) {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
if (config != null) {
|
||||
ctx.register(config);
|
||||
|
|
|
|||
|
|
@ -179,8 +179,8 @@ class TypeElementMembers {
|
|||
return candidate;
|
||||
}
|
||||
TypeMirror alternative = this.typeUtils.getWrapperOrPrimitiveFor(type);
|
||||
if (alternative != null &&
|
||||
this.env.getTypeUtils().isSameType(returnType, alternative)) {
|
||||
if (alternative != null
|
||||
&& this.env.getTypeUtils().isSameType(returnType, alternative)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ public class ItemDeprecation {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "ItemDeprecation{" + "reason='" + this.reason + '\'' + ", "
|
||||
+ "replacement='" + this.replacement + '\'' + ", "
|
||||
+ "level='" + this.level + '\'' + '}';
|
||||
+ "replacement='" + this.replacement + '\'' + ", " + "level='"
|
||||
+ this.level + '\'' + '}';
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -490,8 +490,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
|||
|
||||
@Test
|
||||
public void lombokInnerClassWithGetterProperties() throws IOException {
|
||||
ConfigurationMetadata metadata =
|
||||
compile(LombokInnerClassWithGetterProperties.class);
|
||||
ConfigurationMetadata metadata = compile(
|
||||
LombokInnerClassWithGetterProperties.class);
|
||||
assertThat(metadata).has(Metadata.withGroup("config")
|
||||
.fromSource(LombokInnerClassWithGetterProperties.class));
|
||||
assertThat(metadata).has(Metadata.withGroup("config.first")
|
||||
|
|
@ -541,16 +541,14 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
|||
@Test
|
||||
public void mergeExistingPropertyDeprecation() throws Exception {
|
||||
ItemMetadata property = ItemMetadata.newProperty("simple", "comparator", null,
|
||||
null, null, null, null,
|
||||
new ItemDeprecation("Don't use this.", "simple.complex-comparator",
|
||||
"error"));
|
||||
null, null, null, null, new ItemDeprecation("Don't use this.",
|
||||
"simple.complex-comparator", "error"));
|
||||
writeAdditionalMetadata(property);
|
||||
ConfigurationMetadata metadata = compile(SimpleProperties.class);
|
||||
assertThat(metadata)
|
||||
.has(Metadata.withProperty("simple.comparator", "java.util.Comparator<?>")
|
||||
.fromSource(SimpleProperties.class)
|
||||
.withDeprecation("Don't use this.", "simple.complex-comparator",
|
||||
"error"));
|
||||
.fromSource(SimpleProperties.class).withDeprecation(
|
||||
"Don't use this.", "simple.complex-comparator", "error"));
|
||||
assertThat(metadata.getItems()).hasSize(4);
|
||||
}
|
||||
|
||||
|
|
@ -576,8 +574,8 @@ public class ConfigurationMetadataAnnotationProcessorTests {
|
|||
ConfigurationMetadata metadata = compile(DeprecatedSingleProperty.class);
|
||||
assertThat(metadata).has(
|
||||
Metadata.withProperty("singledeprecated.name", String.class.getName())
|
||||
.fromSource(DeprecatedSingleProperty.class)
|
||||
.withDeprecation("renamed", "singledeprecated.new-name", "error"));
|
||||
.fromSource(DeprecatedSingleProperty.class).withDeprecation(
|
||||
"renamed", "singledeprecated.new-name", "error"));
|
||||
assertThat(metadata.getItems()).hasSize(3);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -320,8 +320,7 @@ public class SpringBootPluginExtension {
|
|||
* Module Layout.
|
||||
* @deprecated as of 1.5 in favor of a custom {@link LayoutFactory}
|
||||
*/
|
||||
@Deprecated
|
||||
MODULE(new Layouts.Module()),
|
||||
@Deprecated MODULE(new Layouts.Module()),
|
||||
|
||||
/**
|
||||
* No layout.
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ public class JsonComponentModule extends SimpleModule implements BeanFactoryAwar
|
|||
addDeserializerWithDeducedType((JsonDeserializer<?>) bean);
|
||||
}
|
||||
for (Class<?> innerClass : bean.getClass().getDeclaredClasses()) {
|
||||
if (!Modifier.isAbstract(innerClass.getModifiers()) &&
|
||||
(JsonSerializer.class.isAssignableFrom(innerClass)
|
||||
if (!Modifier.isAbstract(innerClass.getModifiers())
|
||||
&& (JsonSerializer.class.isAssignableFrom(innerClass)
|
||||
|| JsonDeserializer.class.isAssignableFrom(innerClass))) {
|
||||
try {
|
||||
addJsonBean(innerClass.newInstance());
|
||||
|
|
|
|||
|
|
@ -109,7 +109,8 @@ public class JsonComponentModuleTests {
|
|||
@JsonComponent
|
||||
static class ComponentWithInnerAbstractClass {
|
||||
|
||||
private static abstract class AbstractSerializer extends NameAndAgeJsonComponent.Serializer {
|
||||
private static abstract class AbstractSerializer
|
||||
extends NameAndAgeJsonComponent.Serializer {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue