Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Sep 8, 2015
1 parent 0f6b60d commit 15686ed
Show file tree
Hide file tree
Showing 43 changed files with 73 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public void init() {

@Override
protected Iterable<PropertyDescriptor<?>> createConfigurationCapabilities() {
return Arrays.<PropertyDescriptor<?>> asList(ROLES);
return Arrays.<PropertyDescriptor<?>>asList(ROLES);
}

}
Expand Down Expand Up @@ -458,7 +458,7 @@ public Iterator<InputStream> open(ResourceHandle handle) throws IOException {
return Collections.singletonList(((FileHandle) handle).openStream())
.iterator();
}
return Collections.<InputStream> emptyList().iterator();
return Collections.<InputStream>emptyList().iterator();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void customize(ConfigurableEmbeddedServletContainer container) {
// the same place)
this.server.customize(container);
// Then reset the error pages
container.setErrorPages(Collections.<ErrorPage> emptySet());
container.setErrorPages(Collections.<ErrorPage>emptySet());
// and add the management-specific bits
container.setPort(this.managementServerProperties.getPort());
container.setAddress(this.managementServerProperties.getAddress());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private Map<String, Object> safeSerialize(ObjectMapper mapper, Object bean,
return result;
}
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 + "'"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public ShutdownEndpoint() {
public Map<String, Object> invoke() {

if (this.context == null) {
return Collections.<String, Object> singletonMap("message",
return Collections.<String, Object>singletonMap("message",
"No context to shutdown.");
}

try {
return Collections.<String, Object> singletonMap("message",
return Collections.<String, Object>singletonMap("message",
"Shutting down, bye...");
}
finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class AuditListenerTests {
public void testStoredEvents() {
AuditEventRepository repository = mock(AuditEventRepository.class);
AuditEvent event = new AuditEvent("principal", "type",
Collections.<String, Object> emptyMap());
Collections.<String, Object>emptyMap());
AuditListener listener = new AuditListener(repository);
listener.onApplicationEvent(new AuditApplicationEvent(event));
verify(repository).add(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ PublicMetrics customPublicMetrics() {
@Override
public Collection<Metric<?>> metrics() {
Metric<Integer> metric = new Metric<Integer>("foo", 1);
return Collections.<Metric<?>> singleton(metric);
return Collections.<Metric<?>>singleton(metric);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void idOverride() throws Exception {
public void isSensitiveOverride() throws Exception {
this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".sensitive",
Collections.<String, Object>singletonMap(this.property + ".sensitive",
String.valueOf(!this.sensitive)));
this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass);
Expand All @@ -114,7 +114,7 @@ public void isEnabledByDefault() throws Exception {
public void isEnabledFallbackToEnvironment() throws Exception {
this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".enabled",
Collections.<String, Object>singletonMap(this.property + ".enabled",
false));
this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass);
Expand All @@ -127,7 +127,7 @@ Collections.<String, Object> singletonMap(this.property + ".enabled",
public void isExplicitlyEnabled() throws Exception {
this.context = new AnnotationConfigApplicationContext();
PropertySource<?> propertySource = new MapPropertySource("test",
Collections.<String, Object> singletonMap(this.property + ".enabled",
Collections.<String, Object>singletonMap(this.property + ".enabled",
false));
this.context.getEnvironment().getPropertySources().addFirst(propertySource);
this.context.register(this.configClass);
Expand All @@ -140,7 +140,7 @@ Collections.<String, Object> singletonMap(this.property + ".enabled",
public void isAllEndpointsDisabled() throws Exception {
this.context = new AnnotationConfigApplicationContext();
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.register(this.configClass);
this.context.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public MetricsEndpoint endpoint() {
PublicMetrics metrics = new PublicMetrics() {
@Override
public Collection<Metric<?>> metrics() {
return Collections.<Metric<?>> singleton(metric);
return Collections.<Metric<?>>singleton(metric);
}
};
return new MetricsEndpoint(metrics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void concreteUrlMappings() {
mapping.setApplicationContext(new StaticApplicationContext());
mapping.initApplicationContext();
this.endpoint.setHandlerMappings(Collections
.<AbstractUrlHandlerMapping> singletonList(mapping));
.<AbstractUrlHandlerMapping>singletonList(mapping));
Map<String, Object> result = this.endpoint.invoke();
assertEquals(1, result.size());
@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -114,7 +114,7 @@ public void concreteMethodMappings() {
mapping.setApplicationContext(new StaticApplicationContext());
mapping.afterPropertiesSet();
this.endpoint.setMethodMappings(Collections
.<AbstractHandlerMethodMapping<?>> singletonList(mapping));
.<AbstractHandlerMethodMapping<?>>singletonList(mapping));
Map<String, Object> result = this.endpoint.invoke();
assertEquals(1, result.size());
assertTrue(result.keySet().iterator().next().contains("/dump"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static class Config {
@Bean
public TraceEndpoint endpoint() {
TraceRepository repository = new InMemoryTraceRepository();
repository.add(Collections.<String, Object> singletonMap("a", "b"));
repository.add(Collections.<String, Object>singletonMap("a", "b"));
return new TraceEndpoint(repository);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
public class HealthMvcEndpointTests {

private static final PropertySource<?> NON_SENSITIVE = new MapPropertySource("test",
Collections.<String, Object> singletonMap("endpoints.health.sensitive",
Collections.<String, Object>singletonMap("endpoints.health.sensitive",
"false"));

private HealthEndpoint endpoint = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public MetricsEndpoint endpoint() {

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

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void unprefixedMetricsNotCopied() {

@Test
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)));
this.exporter.export();
assertEquals(1, this.writer.countGroups());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class RedisMultiMetricRepositoryTests {

@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
Expand Down Expand Up @@ -85,37 +85,37 @@ public void clear() {
@Test
public void setAndGet() {
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",
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"))
.iterator().next().getValue());
}

@Test
public void setAndGetMultiple() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>(
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
12.3), new Metric<Number>("foo.bar", 11.3)));
assertEquals(2, Iterables.collection(this.repository.findAll("foo")).size());
}

@Test
public void groups() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>(
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>> asList(new Metric<Number>(
"bar.val", 12.3), new Metric<Number>("bar.foo", 11.3)));
this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>>asList(new Metric<Number>("bar.val",
12.3), new Metric<Number>("bar.foo", 11.3)));
Collection<String> groups = Iterables.collection(this.repository.groups());
assertEquals(2, groups.size());
assertTrue("Wrong groups: " + groups, groups.contains("foo"));
}

@Test
public void count() {
this.repository.set("foo", Arrays.<Metric<?>> asList(new Metric<Number>(
"foo.val", 12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>> asList(new Metric<Number>(
"bar.val", 12.3), new Metric<Number>("bar.foo", 11.3)));
this.repository.set("foo", Arrays.<Metric<?>>asList(new Metric<Number>("foo.val",
12.3), new Metric<Number>("foo.bar", 11.3)));
this.repository.set("bar", Arrays.<Metric<?>>asList(new Metric<Number>("bar.val",
12.3), new Metric<Number>("bar.foo", 11.3)));
assertEquals(2, this.repository.countGroups());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
public class DropwizardMetricWriterTests {

private final MetricRegistry registry = new MetricRegistry();
private final DropwizardMetricWriter writer = new DropwizardMetricWriter(this.registry);
private final DropwizardMetricWriter writer = new DropwizardMetricWriter(
this.registry);

@Test
public void incrementCounter() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void init() {
@Test
public void testAuthenticationSuccess() {
this.listener.onApplicationEvent(new AuthorizationFailureEvent(this, Arrays
.<ConfigAttribute> asList(new SecurityConfig("USER")),
.<ConfigAttribute>asList(new SecurityConfig("USER")),
new UsernamePasswordAuthenticationToken("user", "password"),
new AccessDeniedException("Bad user")));
verify(this.publisher).publishEvent((ApplicationEvent) anyObject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public class InMemoryTraceRepositoryTests {
@Test
public void capacityLimited() {
this.repository.setCapacity(2);
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", "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", "bar"));
List<Trace> traces = this.repository.findAll();
assertEquals(2, traces.size());
assertEquals("bar", traces.get(0).getInfo().get("bar"));
Expand All @@ -48,9 +48,9 @@ public void capacityLimited() {
public void reverseFalse() {
this.repository.setReverse(false);
this.repository.setCapacity(2);
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", "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", "bar"));
List<Trace> traces = this.repository.findAll();
assertEquals(2, traces.size());
assertEquals("bar", traces.get(1).getInfo().get("bar"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public class JacksonProperties {

/**
* 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
* string.
* "date-format" will be used as a fallback if it is configured with a format string.
*/
private String jodaDateTimeFormat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ enum DatabaseDriver {
/**
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public JndiPropertiesHidingClassLoader(ClassLoader parent) {
@Override
public Enumeration<URL> getResources(String name) throws IOException {
if ("jndi.properties".equals(name)) {
return Collections.enumeration(Collections.<URL> emptyList());
return Collections.enumeration(Collections.<URL>emptyList());
}
return super.getResources(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private static void assertDomainTypesDiscovered(MongoMappingContext mappingConte
Set<Class> initialEntitySet = (Set<Class>) ReflectionTestUtils.getField(
mappingContext, "initialEntitySet");
assertThat(initialEntitySet, hasSize(types.length));
assertThat(initialEntitySet, Matchers.<Class> hasItems(types));
assertThat(initialEntitySet, Matchers.<Class>hasItems(types));
}

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void containsDefaults() throws Exception {
for (HttpMessageConverter<?> converter : converters) {
converterClasses.add(converter.getClass());
}
assertThat(converterClasses, equalTo(Arrays.<Class<?>> asList(
assertThat(converterClasses, equalTo(Arrays.<Class<?>>asList(
ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class,
ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class,
AllEncompassingFormHttpMessageConverter.class,
Expand Down Expand Up @@ -117,7 +117,7 @@ protected List<HttpMessageConverter<?>> postProcessConverters(
for (HttpMessageConverter<?> converter : converters) {
converterClasses.add(converter.getClass());
}
assertThat(converterClasses, equalTo(Arrays.<Class<?>> asList(
assertThat(converterClasses, equalTo(Arrays.<Class<?>>asList(
ByteArrayHttpMessageConverter.class, StringHttpMessageConverter.class,
ResourceHttpMessageConverter.class, SourceHttpMessageConverter.class,
AllEncompassingFormHttpMessageConverter.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
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 JarCommand(), new InstallCommand(), new UninstallCommand(),
new InitCommand());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class GroovyTemplate {

public static String template(String name) throws IOException,
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CustomCommandFactory implements CommandFactory {

@Override
public Collection<Command> getCommands() {
return Collections.<Command> singleton(new CustomCommand());
return Collections.<Command>singleton(new CustomCommand());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public String test(String... args) throws Exception {
try {
this.commands.add(future.get(this.timeout, TimeUnit.MILLISECONDS));
return getOutput();
} catch (Exception ex) {
}
catch (Exception ex) {
return getOutput();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class ProjectGenerationRequestTests {

public static final Map<String, String> EMPTY_TAGS = Collections
.<String, String> emptyMap();
.<String, String>emptyMap();

@Rule
public final ExpectedException thrown = ExpectedException.none();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static class EmbeddedAtmosphereInitializer extends AtmosphereInitializer

@Override
public void onStartup(ServletContext servletContext) throws ServletException {
onStartup(Collections.<Class<?>> emptySet(), servletContext);
onStartup(Collections.<Class<?>>emptySet(), servletContext);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
public interface FieldValuesParser {

/**
* Implementation of {@link FieldValuesParser} that always returns an empty
* result.
* Implementation of {@link FieldValuesParser} that always returns an empty result.
*/
public static final FieldValuesParser NONE = new FieldValuesParser() {

Expand Down
Loading

0 comments on commit 15686ed

Please sign in to comment.