Reformat code

pull/3605/merge
Phillip Webb 9 years ago
parent 0f6b60d8c8
commit 15686ed4fd

@ -338,7 +338,7 @@ public class CrshAutoConfiguration {
@Override @Override
protected Iterable<PropertyDescriptor<?>> createConfigurationCapabilities() { protected Iterable<PropertyDescriptor<?>> createConfigurationCapabilities() {
return Arrays.<PropertyDescriptor<?>> asList(ROLES); return Arrays.<PropertyDescriptor<?>>asList(ROLES);
} }
} }
@ -458,7 +458,7 @@ public class CrshAutoConfiguration {
return Collections.singletonList(((FileHandle) handle).openStream()) return Collections.singletonList(((FileHandle) handle).openStream())
.iterator(); .iterator();
} }
return Collections.<InputStream> emptyList().iterator(); return Collections.<InputStream>emptyList().iterator();
} }
@Override @Override

@ -112,7 +112,7 @@ public class EndpointWebMvcChildContextConfiguration {
// the same place) // the same place)
this.server.customize(container); this.server.customize(container);
// Then reset the error pages // Then reset the error pages
container.setErrorPages(Collections.<ErrorPage> emptySet()); container.setErrorPages(Collections.<ErrorPage>emptySet());
// and add the management-specific bits // and add the management-specific bits
container.setPort(this.managementServerProperties.getPort()); container.setPort(this.managementServerProperties.getPort());
container.setAddress(this.managementServerProperties.getAddress()); container.setAddress(this.managementServerProperties.getAddress());

@ -184,7 +184,7 @@ public class ConfigurationPropertiesReportEndpoint extends
return result; return result;
} }
catch (Exception ex) { catch (Exception ex) {
return new HashMap<String, Object>(Collections.<String, Object> singletonMap( return new HashMap<String, Object>(Collections.<String, Object>singletonMap(
"error", "Cannot serialize '" + prefix + "'")); "error", "Cannot serialize '" + prefix + "'"));
} }
} }

@ -48,12 +48,12 @@ public class ShutdownEndpoint extends AbstractEndpoint<Map<String, Object>> impl
public Map<String, Object> invoke() { public Map<String, Object> invoke() {
if (this.context == null) { if (this.context == null) {
return Collections.<String, Object> singletonMap("message", return Collections.<String, Object>singletonMap("message",
"No context to shutdown."); "No context to shutdown.");
} }
try { try {
return Collections.<String, Object> singletonMap("message", return Collections.<String, Object>singletonMap("message",
"Shutting down, bye..."); "Shutting down, bye...");
} }
finally { finally {

@ -36,7 +36,7 @@ public class AuditListenerTests {
public void testStoredEvents() { public void testStoredEvents() {
AuditEventRepository repository = mock(AuditEventRepository.class); AuditEventRepository repository = mock(AuditEventRepository.class);
AuditEvent event = new AuditEvent("principal", "type", AuditEvent event = new AuditEvent("principal", "type",
Collections.<String, Object> emptyMap()); Collections.<String, Object>emptyMap());
AuditListener listener = new AuditListener(repository); AuditListener listener = new AuditListener(repository);
listener.onApplicationEvent(new AuditApplicationEvent(event)); listener.onApplicationEvent(new AuditApplicationEvent(event));
verify(repository).add(event); verify(repository).add(event);

@ -171,7 +171,7 @@ public class EndpointAutoConfigurationTests {
@Override @Override
public Collection<Metric<?>> metrics() { public Collection<Metric<?>> metrics() {
Metric<Integer> metric = new Metric<Integer>("foo", 1); Metric<Integer> metric = new Metric<Integer>("foo", 1);
return Collections.<Metric<?>> singleton(metric); return Collections.<Metric<?>>singleton(metric);
} }
}; };
} }

@ -97,7 +97,7 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
public void isSensitiveOverride() throws Exception { public void isSensitiveOverride() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test", PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".sensitive", Collections.<String, Object>singletonMap(this.property + ".sensitive",
String.valueOf(!this.sensitive))); String.valueOf(!this.sensitive)));
this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass); this.context.register(this.configClass);
@ -114,7 +114,7 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
public void isEnabledFallbackToEnvironment() throws Exception { public void isEnabledFallbackToEnvironment() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test", PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".enabled", Collections.<String, Object>singletonMap(this.property + ".enabled",
false)); false));
this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass); this.context.register(this.configClass);
@ -127,7 +127,7 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
public void isExplicitlyEnabled() throws Exception { public void isExplicitlyEnabled() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test", PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".enabled", Collections.<String, Object>singletonMap(this.property + ".enabled",
false)); false));
this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass); this.context.register(this.configClass);
@ -140,7 +140,7 @@ public abstract class AbstractEndpointTests<T extends Endpoint<?>> {
public void isAllEndpointsDisabled() throws Exception { public void isAllEndpointsDisabled() throws Exception {
this.context = new AnnotationConfigApplicationContext(); this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test", PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap("endpoints.enabled", false)); Collections.<String, Object>singletonMap("endpoints.enabled", false));
this.context.getEnvironment().getPropertySources().addFirst(propertySource); this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass); this.context.register(this.configClass);
this.context.refresh(); this.context.refresh();

@ -106,7 +106,7 @@ public class MetricsEndpointTests extends AbstractEndpointTests<MetricsEndpoint>
PublicMetrics metrics = new PublicMetrics() { PublicMetrics metrics = new PublicMetrics() {
@Override @Override
public Collection<Metric<?>> metrics() { public Collection<Metric<?>> metrics() {
return Collections.<Metric<?>> singleton(metric); return Collections.<Metric<?>>singleton(metric);
} }
}; };
return new MetricsEndpoint(metrics); return new MetricsEndpoint(metrics);

@ -53,7 +53,7 @@ public class RequestMappingEndpointTests {
mapping.setApplicationContext(new StaticApplicationContext()); mapping.setApplicationContext(new StaticApplicationContext());
mapping.initApplicationContext(); mapping.initApplicationContext();
this.endpoint.setHandlerMappings(Collections this.endpoint.setHandlerMappings(Collections
.<AbstractUrlHandlerMapping> singletonList(mapping)); .<AbstractUrlHandlerMapping>singletonList(mapping));
Map<String, Object> result = this.endpoint.invoke(); Map<String, Object> result = this.endpoint.invoke();
assertEquals(1, result.size()); assertEquals(1, result.size());
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -114,7 +114,7 @@ public class RequestMappingEndpointTests {
mapping.setApplicationContext(new StaticApplicationContext()); mapping.setApplicationContext(new StaticApplicationContext());
mapping.afterPropertiesSet(); mapping.afterPropertiesSet();
this.endpoint.setMethodMappings(Collections this.endpoint.setMethodMappings(Collections
.<AbstractHandlerMethodMapping<?>> singletonList(mapping)); .<AbstractHandlerMethodMapping<?>>singletonList(mapping));
Map<String, Object> result = this.endpoint.invoke(); Map<String, Object> result = this.endpoint.invoke();
assertEquals(1, result.size()); assertEquals(1, result.size());
assertTrue(result.keySet().iterator().next().contains("/dump")); assertTrue(result.keySet().iterator().next().contains("/dump"));

@ -53,7 +53,7 @@ public class TraceEndpointTests extends AbstractEndpointTests<TraceEndpoint> {
@Bean @Bean
public TraceEndpoint endpoint() { public TraceEndpoint endpoint() {
TraceRepository repository = new InMemoryTraceRepository(); TraceRepository repository = new InMemoryTraceRepository();
repository.add(Collections.<String, Object> singletonMap("a", "b")); repository.add(Collections.<String, Object>singletonMap("a", "b"));
return new TraceEndpoint(repository); return new TraceEndpoint(repository);
} }
} }

@ -49,7 +49,7 @@ import static org.mockito.Mockito.mock;
public class HealthMvcEndpointTests { public class HealthMvcEndpointTests {
private static final PropertySource<?> NON_SENSITIVE = new MapPropertySource("test", private static final PropertySource<?> NON_SENSITIVE = new MapPropertySource("test",
Collections.<String, Object> singletonMap("endpoints.health.sensitive", Collections.<String, Object>singletonMap("endpoints.health.sensitive",
"false")); "false"));
private HealthEndpoint endpoint = null; private HealthEndpoint endpoint = null;

@ -108,7 +108,7 @@ public class MetricsMvcEndpointTests {
@Override @Override
public Collection<Metric<?>> metrics() { public Collection<Metric<?>> metrics() {
return Arrays.<Metric<?>> asList(new Metric<Integer>("foo", 1)); return Arrays.<Metric<?>>asList(new Metric<Integer>("foo", 1));
} }
}); });

@ -60,7 +60,7 @@ public class PrefixMetricGroupExporterTests {
@Test @Test
public void multiMetricGroupsCopiedAsDefault() { public void multiMetricGroupsCopiedAsDefault() {
this.reader.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>("bar", 2.3), this.reader.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("bar", 2.3),
new Metric<Number>("spam", 1.3))); new Metric<Number>("spam", 1.3)));
this.exporter.export(); this.exporter.export();
assertEquals(1, this.writer.countGroups()); assertEquals(1, this.writer.countGroups());

@ -55,7 +55,7 @@ public class RedisMultiMetricRepositoryTests {
@Parameters @Parameters
public static List<Object[]> parameters() { public static List<Object[]> parameters() {
return Arrays.<Object[]> asList(new Object[] { null }, new Object[] { "test" }); return Arrays.<Object[]>asList(new Object[] { null }, new Object[] { "test" });
} }
@Before @Before
@ -85,26 +85,26 @@ public class RedisMultiMetricRepositoryTests {
@Test @Test
public void setAndGet() { public void setAndGet() {
this.repository.set("foo", this.repository.set("foo",
Arrays.<Metric<?>> asList(new Metric<Number>("foo.bar", 12.3))); Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 12.3)));
this.repository.set("foo", this.repository.set("foo",
Arrays.<Metric<?>> asList(new Metric<Number>("foo.bar", 15.3))); Arrays.<Metric<?>>asList(new Metric<Number>("foo.bar", 15.3)));
assertEquals(15.3, Iterables.collection(this.repository.findAll("foo")) assertEquals(15.3, Iterables.collection(this.repository.findAll("foo"))
.iterator().next().getValue()); .iterator().next().getValue());
} }
@Test @Test
public void setAndGetMultiple() { public void setAndGetMultiple() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>( this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3))); 12.3), new Metric<Number>("foo.bar", 11.3)));
assertEquals(2, Iterables.collection(this.repository.findAll("foo")).size()); assertEquals(2, Iterables.collection(this.repository.findAll("foo")).size());
} }
@Test @Test
public void groups() { public void groups() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>( this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3))); 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>> asList(new Metric<Number>( this.repository.set("bar", Arrays.<Metric<?>>asList(new Metric<Number>("bar.val",
"bar.val", 12.3), new Metric<Number>("bar.foo", 11.3))); 12.3), new Metric<Number>("bar.foo", 11.3)));
Collection<String> groups = Iterables.collection(this.repository.groups()); Collection<String> groups = Iterables.collection(this.repository.groups());
assertEquals(2, groups.size()); assertEquals(2, groups.size());
assertTrue("Wrong groups: " + groups, groups.contains("foo")); assertTrue("Wrong groups: " + groups, groups.contains("foo"));
@ -112,10 +112,10 @@ public class RedisMultiMetricRepositoryTests {
@Test @Test
public void count() { public void count() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>( this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3))); 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>> asList(new Metric<Number>( this.repository.set("bar", Arrays.<Metric<?>>asList(new Metric<Number>("bar.val",
"bar.val", 12.3), new Metric<Number>("bar.foo", 11.3))); 12.3), new Metric<Number>("bar.foo", 11.3)));
assertEquals(2, this.repository.countGroups()); assertEquals(2, this.repository.countGroups());
} }

@ -36,7 +36,8 @@ import static org.junit.Assert.assertFalse;
public class DropwizardMetricWriterTests { public class DropwizardMetricWriterTests {
private final MetricRegistry registry = new MetricRegistry(); private final MetricRegistry registry = new MetricRegistry();
private final DropwizardMetricWriter writer = new DropwizardMetricWriter(this.registry); private final DropwizardMetricWriter writer = new DropwizardMetricWriter(
this.registry);
@Test @Test
public void incrementCounter() { public void incrementCounter() {

@ -49,7 +49,7 @@ public class AuthorizationAuditListenerTests {
@Test @Test
public void testAuthenticationSuccess() { public void testAuthenticationSuccess() {
this.listener.onApplicationEvent(new AuthorizationFailureEvent(this, Arrays this.listener.onApplicationEvent(new AuthorizationFailureEvent(this, Arrays
.<ConfigAttribute> asList(new SecurityConfig("USER")), .<ConfigAttribute>asList(new SecurityConfig("USER")),
new UsernamePasswordAuthenticationToken("user", "password"), new UsernamePasswordAuthenticationToken("user", "password"),
new AccessDeniedException("Bad user"))); new AccessDeniedException("Bad user")));
verify(this.publisher).publishEvent((ApplicationEvent) anyObject()); verify(this.publisher).publishEvent((ApplicationEvent) anyObject());

@ -35,9 +35,9 @@ public class InMemoryTraceRepositoryTests {
@Test @Test
public void capacityLimited() { public void capacityLimited() {
this.repository.setCapacity(2); this.repository.setCapacity(2);
this.repository.add(Collections.<String, Object> singletonMap("foo", "bar")); this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
this.repository.add(Collections.<String, Object> singletonMap("bar", "foo")); this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
this.repository.add(Collections.<String, Object> singletonMap("bar", "bar")); this.repository.add(Collections.<String, Object>singletonMap("bar", "bar"));
List<Trace> traces = this.repository.findAll(); List<Trace> traces = this.repository.findAll();
assertEquals(2, traces.size()); assertEquals(2, traces.size());
assertEquals("bar", traces.get(0).getInfo().get("bar")); assertEquals("bar", traces.get(0).getInfo().get("bar"));
@ -48,9 +48,9 @@ public class InMemoryTraceRepositoryTests {
public void reverseFalse() { public void reverseFalse() {
this.repository.setReverse(false); this.repository.setReverse(false);
this.repository.setCapacity(2); this.repository.setCapacity(2);
this.repository.add(Collections.<String, Object> singletonMap("foo", "bar")); this.repository.add(Collections.<String, Object>singletonMap("foo", "bar"));
this.repository.add(Collections.<String, Object> singletonMap("bar", "foo")); this.repository.add(Collections.<String, Object>singletonMap("bar", "foo"));
this.repository.add(Collections.<String, Object> singletonMap("bar", "bar")); this.repository.add(Collections.<String, Object>singletonMap("bar", "bar"));
List<Trace> traces = this.repository.findAll(); List<Trace> traces = this.repository.findAll();
assertEquals(2, traces.size()); assertEquals(2, traces.size());
assertEquals("bar", traces.get(1).getInfo().get("bar")); assertEquals("bar", traces.get(1).getInfo().get("bar"));

@ -45,8 +45,7 @@ public class JacksonProperties {
/** /**
* Joda date time format string (yyyy-MM-dd HH:mm:ss). If not configured, * Joda date time format string (yyyy-MM-dd HH:mm:ss). If not configured,
* "date-format" will be used as a fallback if it is configured with a format * "date-format" will be used as a fallback if it is configured with a format string.
* string.
*/ */
private String jodaDateTimeFormat; private String jodaDateTimeFormat;

@ -86,7 +86,8 @@ enum DatabaseDriver {
/** /**
* SQL Server * SQL Server
*/ */
SQLSERVER("com.microsoft.sqlserver.jdbc.SQLServerDriver", "com.microsoft.sqlserver.jdbc.SQLServerXADataSource"); SQLSERVER("com.microsoft.sqlserver.jdbc.SQLServerDriver",
"com.microsoft.sqlserver.jdbc.SQLServerXADataSource");
private final String driverClassName; private final String driverClassName;

@ -36,7 +36,7 @@ public class JndiPropertiesHidingClassLoader extends ClassLoader {
@Override @Override
public Enumeration<URL> getResources(String name) throws IOException { public Enumeration<URL> getResources(String name) throws IOException {
if ("jndi.properties".equals(name)) { if ("jndi.properties".equals(name)) {
return Collections.enumeration(Collections.<URL> emptyList()); return Collections.enumeration(Collections.<URL>emptyList());
} }
return super.getResources(name); return super.getResources(name);
} }

@ -109,7 +109,7 @@ public class MongoDataAutoConfigurationTests {
Set<Class> initialEntitySet = (Set<Class>) ReflectionTestUtils.getField( Set<Class> initialEntitySet = (Set<Class>) ReflectionTestUtils.getField(
mappingContext, "initialEntitySet"); mappingContext, "initialEntitySet");
assertThat(initialEntitySet, hasSize(types.length)); assertThat(initialEntitySet, hasSize(types.length));
assertThat(initialEntitySet, Matchers.<Class> hasItems(types)); assertThat(initialEntitySet, Matchers.<Class>hasItems(types));
} }
@Configuration @Configuration

@ -58,7 +58,7 @@ public class HttpMessageConvertersTests {
for (HttpMessageConverter<?> converter : converters) { for (HttpMessageConverter<?> converter : converters) {
converterClasses.add(converter.getClass()); converterClasses.add(converter.getClass());
} }
assertThat(converterClasses, equalTo(Arrays.<Class<?>> asList( assertThat(converterClasses, equalTo(Arrays.<Class<?>>asList(
ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class, ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class,
ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class, ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class,
AllEncompassingFormHttpMessageConverter.class, AllEncompassingFormHttpMessageConverter.class,
@ -117,7 +117,7 @@ public class HttpMessageConvertersTests {
for (HttpMessageConverter<?> converter : converters) { for (HttpMessageConverter<?> converter : converters) {
converterClasses.add(converter.getClass()); converterClasses.add(converter.getClass());
} }
assertThat(converterClasses, equalTo(Arrays.<Class<?>> asList( assertThat(converterClasses, equalTo(Arrays.<Class<?>>asList(
ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class, ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class,
ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class, ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class,
AllEncompassingFormHttpMessageConverter.class, AllEncompassingFormHttpMessageConverter.class,

@ -38,7 +38,7 @@ import org.springframework.boot.cli.command.test.TestCommand;
*/ */
public class DefaultCommandFactory implements CommandFactory { public class DefaultCommandFactory implements CommandFactory {
private static final List<Command> DEFAULT_COMMANDS = Arrays.<Command> asList( private static final List<Command> DEFAULT_COMMANDS = Arrays.<Command>asList(
new VersionCommand(), new RunCommand(), new TestCommand(), new GrabCommand(), new VersionCommand(), new RunCommand(), new TestCommand(), new GrabCommand(),
new JarCommand(), new InstallCommand(), new UninstallCommand(), new JarCommand(), new InstallCommand(), new UninstallCommand(),
new InitCommand()); new InitCommand());

@ -39,7 +39,7 @@ public abstract class GroovyTemplate {
public static String template(String name) throws IOException, public static String template(String name) throws IOException,
CompilationFailedException, ClassNotFoundException { CompilationFailedException, ClassNotFoundException {
return template(name, Collections.<String, Object> emptyMap()); return template(name, Collections.<String, Object>emptyMap());
} }
public static String template(String name, Map<String, ?> model) throws IOException, public static String template(String name, Map<String, ?> model) throws IOException,

@ -29,7 +29,7 @@ public class CustomCommandFactory implements CommandFactory {
@Override @Override
public Collection<Command> getCommands() { public Collection<Command> getCommands() {
return Collections.<Command> singleton(new CustomCommand()); return Collections.<Command>singleton(new CustomCommand());
} }
} }

@ -81,7 +81,8 @@ public class CliTester implements TestRule {
try { try {
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS)); this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
return getOutput(); return getOutput();
} catch (Exception ex) { }
catch (Exception ex) {
return getOutput(); return getOutput();
} }
} }

@ -41,7 +41,7 @@ import static org.junit.Assert.assertEquals;
public class ProjectGenerationRequestTests { public class ProjectGenerationRequestTests {
public static final Map<String, String> EMPTY_TAGS = Collections public static final Map<String, String> EMPTY_TAGS = Collections
.<String, String> emptyMap(); .<String, String>emptyMap();
@Rule @Rule
public final ExpectedException thrown = ExpectedException.none(); public final ExpectedException thrown = ExpectedException.none();

@ -72,7 +72,7 @@ public class SampleAtmosphereApplication {
@Override @Override
public void onStartup(ServletContext servletContext) throws ServletException { public void onStartup(ServletContext servletContext) throws ServletException {
onStartup(Collections.<Class<?>> emptySet(), servletContext); onStartup(Collections.<Class<?>>emptySet(), servletContext);
} }
} }

@ -33,8 +33,7 @@ import org.springframework.boot.configurationprocessor.fieldvalues.javac.JavaCom
public interface FieldValuesParser { public interface FieldValuesParser {
/** /**
* Implementation of {@link FieldValuesParser} that always returns an empty * Implementation of {@link FieldValuesParser} that always returns an empty result.
* result.
*/ */
public static final FieldValuesParser NONE = new FieldValuesParser() { public static final FieldValuesParser NONE = new FieldValuesParser() {

@ -16,7 +16,6 @@
package org.springframework.boot.configurationsample.simple; package org.springframework.boot.configurationsample.simple;
/** /**
* This has no annotation on purpose to check that no meta-data is generated. * This has no annotation on purpose to check that no meta-data is generated.
* *

@ -42,7 +42,7 @@ public final class Dependency {
* @param version the version * @param version the version
*/ */
public Dependency(String groupId, String artifactId, String version) { public Dependency(String groupId, String artifactId, String version) {
this(groupId, artifactId, version, Collections.<Exclusion> emptyList()); this(groupId, artifactId, version, Collections.<Exclusion>emptyList());
} }
/** /**

@ -93,7 +93,7 @@ public abstract class ManagedDependencies implements Dependencies {
* @see #get(Collection) * @see #get(Collection)
*/ */
public static ManagedDependencies get() { public static ManagedDependencies get() {
return get(Collections.<Dependencies> emptySet()); return get(Collections.<Dependencies>emptySet());
} }
/** /**

@ -41,7 +41,7 @@ public class ManagedDependenciesDelegateTests {
PropertiesFileDependencies extra = new PropertiesFileDependencies(getClass() PropertiesFileDependencies extra = new PropertiesFileDependencies(getClass()
.getResourceAsStream("additional-external.properties")); .getResourceAsStream("additional-external.properties"));
this.dependencies = new ManagedDependenciesDelegate(root, this.dependencies = new ManagedDependenciesDelegate(root,
Collections.<Dependencies> singleton(extra)); Collections.<Dependencies>singleton(extra));
} }
@Test @Test

@ -138,8 +138,7 @@ public class PropertiesLauncherTests {
public void testCustomClassLoaderCreation() throws Exception { public void testCustomClassLoaderCreation() throws Exception {
System.setProperty("loader.classLoader", TestLoader.class.getName()); System.setProperty("loader.classLoader", TestLoader.class.getName());
PropertiesLauncher launcher = new PropertiesLauncher(); PropertiesLauncher launcher = new PropertiesLauncher();
ClassLoader loader = launcher ClassLoader loader = launcher.createClassLoader(Collections.<Archive>emptyList());
.createClassLoader(Collections.<Archive> emptyList());
assertNotNull(loader); assertNotNull(loader);
assertEquals(TestLoader.class.getName(), loader.getClass().getName()); assertEquals(TestLoader.class.getName(), loader.getClass().getName());
} }

@ -42,7 +42,7 @@ public class DependencyFilterMojoTests {
@Test @Test
public void filterDependencies() throws MojoExecutionException { public void filterDependencies() throws MojoExecutionException {
TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo(
Collections.<Exclude> emptyList(), "com.foo", "exclude-id"); Collections.<Exclude>emptyList(), "com.foo", "exclude-id");
Artifact artifact = createArtifact("com.bar", "one"); Artifact artifact = createArtifact("com.bar", "one");
Set<Artifact> artifacts = mojo.filterDependencies( Set<Artifact> artifacts = mojo.filterDependencies(
@ -55,7 +55,7 @@ public class DependencyFilterMojoTests {
@Test @Test
public void filterGroupIdExactMatch() throws MojoExecutionException { public void filterGroupIdExactMatch() throws MojoExecutionException {
TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo( TestableDependencyFilterMojo mojo = new TestableDependencyFilterMojo(
Collections.<Exclude> emptyList(), "com.foo", ""); Collections.<Exclude>emptyList(), "com.foo", "");
Artifact artifact = createArtifact("com.foo.bar", "one"); Artifact artifact = createArtifact("com.foo.bar", "one");
Set<Artifact> artifacts = mojo.filterDependencies( Set<Artifact> artifacts = mojo.filterDependencies(

@ -101,7 +101,7 @@ public class AtomikosDependsOnBeanFactoryPostProcessor implements
} }
private List<String> asList(String[] array) { private List<String> asList(String[] array) {
return (array == null ? Collections.<String> emptyList() : Arrays.asList(array)); return (array == null ? Collections.<String>emptyList() : Arrays.asList(array));
} }
@Override @Override

@ -85,7 +85,7 @@ public class TestRestTemplate extends RestTemplate {
return; return;
} }
List<ClientHttpRequestInterceptor> interceptors = Collections List<ClientHttpRequestInterceptor> interceptors = Collections
.<ClientHttpRequestInterceptor> singletonList(new BasicAuthorizationInterceptor( .<ClientHttpRequestInterceptor>singletonList(new BasicAuthorizationInterceptor(
username, password)); username, password));
setRequestFactory(new InterceptingClientHttpRequestFactory(getRequestFactory(), setRequestFactory(new InterceptingClientHttpRequestFactory(getRequestFactory(),
interceptors)); interceptors));

@ -77,7 +77,7 @@ public class ResourceBannerTests {
ResourceBanner banner = new MockResourceBanner(resource, bootVersion, ResourceBanner banner = new MockResourceBanner(resource, bootVersion,
applicationVersion); applicationVersion);
ConfigurableEnvironment environment = new MockEnvironment(); ConfigurableEnvironment environment = new MockEnvironment();
Map<String, Object> source = Collections.<String, Object> singletonMap("a", "1"); Map<String, Object> source = Collections.<String, Object>singletonMap("a", "1");
environment.getPropertySources().addLast(new MapPropertySource("map", source)); environment.getPropertySources().addLast(new MapPropertySource("map", source));
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
banner.printBanner(environment, getClass(), new PrintStream(out)); banner.printBanner(environment, getClass(), new PrintStream(out));

@ -314,7 +314,7 @@ public class SpringApplicationTests {
ConfigurableEnvironment environment = new StandardEnvironment(); ConfigurableEnvironment environment = new StandardEnvironment();
environment.getPropertySources().addFirst( environment.getPropertySources().addFirst(
new MapPropertySource("commandLineArgs", Collections new MapPropertySource("commandLineArgs", Collections
.<String, Object> singletonMap("foo", "original"))); .<String, Object>singletonMap("foo", "original")));
application.setEnvironment(environment); application.setEnvironment(environment);
application.run("--foo=bar", "--bar=foo"); application.run("--foo=bar", "--bar=foo");
assertTrue(hasPropertySource(environment, CompositePropertySource.class, assertTrue(hasPropertySource(environment, CompositePropertySource.class,

@ -56,12 +56,12 @@ public class PropertySourcesPropertyValuesTests {
}); });
this.propertySources.addFirst(new MapPropertySource("map", Collections this.propertySources.addFirst(new MapPropertySource("map", Collections
.<String, Object> singletonMap("name", "${foo}"))); .<String, Object>singletonMap("name", "${foo}")));
} }
@Test @Test
public void testTypesPreserved() { public void testTypesPreserved() {
Map<String, Object> map = Collections.<String, Object> singletonMap("name", 123); Map<String, Object> map = Collections.<String, Object>singletonMap("name", 123);
this.propertySources.replace("map", new MapPropertySource("map", map)); this.propertySources.replace("map", new MapPropertySource("map", map));
PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues( PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues(
this.propertySources); this.propertySources);
@ -142,7 +142,7 @@ public class PropertySourcesPropertyValuesTests {
@Test @Test
public void testOverriddenValue() { public void testOverriddenValue() {
this.propertySources.addFirst(new MapPropertySource("new", Collections this.propertySources.addFirst(new MapPropertySource("new", Collections
.<String, Object> singletonMap("name", "spam"))); .<String, Object>singletonMap("name", "spam")));
PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues( PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues(
this.propertySources); this.propertySources);
assertEquals("spam", propertyValues.getPropertyValue("name").getValue()); assertEquals("spam", propertyValues.getPropertyValue("name").getValue());
@ -170,7 +170,7 @@ public class PropertySourcesPropertyValuesTests {
TestBean target = new TestBean(); TestBean target = new TestBean();
DataBinder binder = new DataBinder(target); DataBinder binder = new DataBinder(target);
this.propertySources.addFirst(new MapPropertySource("another", Collections this.propertySources.addFirst(new MapPropertySource("another", Collections
.<String, Object> singletonMap("something", "${nonexistent}"))); .<String, Object>singletonMap("something", "${nonexistent}")));
binder.bind(new PropertySourcesPropertyValues(this.propertySources)); binder.bind(new PropertySourcesPropertyValues(this.propertySources));
assertEquals("bar", target.getName()); assertEquals("bar", target.getName());
} }

@ -75,7 +75,7 @@ public class SpringApplicationBuilderTests {
SpringApplicationBuilder application = new SpringApplicationBuilder() SpringApplicationBuilder application = new SpringApplicationBuilder()
.sources(ExampleConfig.class) .sources(ExampleConfig.class)
.contextClass(StaticApplicationContext.class) .contextClass(StaticApplicationContext.class)
.properties(Collections.<String, Object> singletonMap("bar", "foo")); .properties(Collections.<String, Object>singletonMap("bar", "foo"));
this.context = application.run(); this.context = application.run();
assertThat(this.context.getEnvironment().getProperty("bar"), is(equalTo("foo"))); assertThat(this.context.getEnvironment().getProperty("bar"), is(equalTo("foo")));
} }

@ -149,7 +149,7 @@ public class MockEmbeddedServletContainerFactory extends
} }
}); });
given(this.servletContext.getAttributeNames()).willReturn( given(this.servletContext.getAttributeNames()).willReturn(
MockEmbeddedServletContainer.<String> emptyEnumeration()); MockEmbeddedServletContainer.<String>emptyEnumeration());
given(this.servletContext.getNamedDispatcher("default")).willReturn( given(this.servletContext.getNamedDispatcher("default")).willReturn(
mock(RequestDispatcher.class)); mock(RequestDispatcher.class));
for (ServletContextInitializer initializer : this.initializers) { for (ServletContextInitializer initializer : this.initializers) {

@ -157,7 +157,7 @@ public class EnableConfigurationPropertiesTests {
public void testExceptionOnValidation() { public void testExceptionOnValidation() {
this.context.register(ExceptionIfInvalidTestConfiguration.class); this.context.register(ExceptionIfInvalidTestConfiguration.class);
EnvironmentTestUtils.addEnvironment(this.context, "name:foo"); EnvironmentTestUtils.addEnvironment(this.context, "name:foo");
this.expected.expectCause(Matchers.<Throwable> instanceOf(BindException.class)); this.expected.expectCause(Matchers.<Throwable>instanceOf(BindException.class));
this.context.refresh(); this.context.refresh();
} }

Loading…
Cancel
Save