Remove explicit type arguments

See gh-10494
This commit is contained in:
Johnny Lim
2017-10-03 01:25:51 +09:00
committed by Andy Wilkinson
parent a256602c7b
commit 6168fae720
61 changed files with 105 additions and 108 deletions

View File

@@ -39,11 +39,11 @@ import org.springframework.context.ConfigurableApplicationContext;
public class ShutdownEndpoint implements ApplicationContextAware {
private static final Map<String, String> NO_CONTEXT_MESSAGE = Collections
.unmodifiableMap(Collections.<String, String>singletonMap("message",
.unmodifiableMap(Collections.singletonMap("message",
"No context to shutdown."));
private static final Map<String, String> SHUTDOWN_MESSAGE = Collections
.unmodifiableMap(Collections.<String, String>singletonMap("message",
.unmodifiableMap(Collections.singletonMap("message",
"Shutting down, bye..."));
private ConfigurableApplicationContext context;

View File

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

View File

@@ -106,7 +106,7 @@ public class AuditEventsEndpointWebIntegrationTests {
private AuditEvent createEvent(String instant, String principal, String type) {
return new AuditEvent(Date.from(Instant.parse(instant)), principal, type,
Collections.<String, Object>emptyMap());
Collections.emptyMap());
}
}

View File

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

View File

@@ -25,7 +25,6 @@ import org.mockito.ArgumentCaptor;
import org.springframework.boot.actuate.audit.listener.AuditApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.access.event.AbstractAuthorizationEvent;
import org.springframework.security.access.event.AuthenticationCredentialsNotFoundEvent;
@@ -56,7 +55,7 @@ public class AuthorizationAuditListenerTests {
public void testAuthenticationCredentialsNotFound() {
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthenticationCredentialsNotFoundEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
new AuthenticationCredentialsNotFoundException("Bad user")));
assertThat(event.getAuditEvent().getType())
@@ -67,7 +66,7 @@ public class AuthorizationAuditListenerTests {
public void testAuthorizationFailure() {
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
new UsernamePasswordAuthenticationToken("user", "password"),
new AccessDeniedException("Bad user")));
@@ -83,7 +82,7 @@ public class AuthorizationAuditListenerTests {
authentication.setDetails(details);
AuditApplicationEvent event = handleAuthorizationEvent(
new AuthorizationFailureEvent(this,
Collections.<ConfigAttribute>singletonList(
Collections.singletonList(
new SecurityConfig("USER")),
authentication, new AccessDeniedException("Bad user")));
assertThat(event.getAuditEvent().getType())

View File

@@ -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.singletonMap("foo", "bar"));
this.repository.add(Collections.singletonMap("bar", "foo"));
this.repository.add(Collections.singletonMap("bar", "bar"));
List<Trace> traces = this.repository.findAll();
assertThat(traces).hasSize(2);
assertThat(traces.get(0).getInfo().get("bar")).isEqualTo("bar");
@@ -48,9 +48,9 @@ public class InMemoryTraceRepositoryTests {
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.singletonMap("foo", "bar"));
this.repository.add(Collections.singletonMap("bar", "foo"));
this.repository.add(Collections.singletonMap("bar", "bar"));
List<Trace> traces = this.repository.findAll();
assertThat(traces).hasSize(2);
assertThat(traces.get(1).getInfo().get("bar")).isEqualTo("bar");

View File

@@ -33,7 +33,7 @@ public class TraceEndpointTests {
@Test
public void trace() throws Exception {
TraceRepository repository = new InMemoryTraceRepository();
repository.add(Collections.<String, Object>singletonMap("a", "b"));
repository.add(Collections.singletonMap("a", "b"));
Trace trace = new TraceEndpoint(repository).traces().getTraces().get(0);
assertThat(trace.getInfo().get("a")).isEqualTo("b");
}