Remove redundant type arguments

This commit is contained in:
Ville Skyttä 2016-06-14 00:20:31 +03:00 committed by Clebert Suconic
parent 560ba1b39b
commit 33a51223b0
13 changed files with 23 additions and 23 deletions

View File

@ -474,7 +474,7 @@ public class URISupport {
if (options.size() > 0) { if (options.size() > 0) {
StringBuilder rc = new StringBuilder(); StringBuilder rc = new StringBuilder();
boolean first = true; boolean first = true;
List<String> keys = new ArrayList<String>(); List<String> keys = new ArrayList<>();
keys.addAll(options.keySet()); keys.addAll(options.keySet());
Collections.sort(keys); Collections.sort(keys);
for (String key : keys) { for (String key : keys) {

View File

@ -104,7 +104,7 @@ public class URIParserTest {
@Test @Test
public void testQueryConversion() throws Exception { public void testQueryConversion() throws Exception {
Map<String, String> query = new HashMap<String, String>(); Map<String, String> query = new HashMap<>();
String queryString = URISupport.createQueryString(query); String queryString = URISupport.createQueryString(query);
System.out.println("queryString1: " + queryString); System.out.println("queryString1: " + queryString);
Assert.assertTrue(queryString.isEmpty()); Assert.assertTrue(queryString.isEmpty());

View File

@ -30,9 +30,9 @@ final class TransactionHolder {
public final long transactionID; public final long transactionID;
public final List<RecordInfo> recordInfos = new ArrayList<RecordInfo>(); public final List<RecordInfo> recordInfos = new ArrayList<>();
public final List<RecordInfo> recordsToDelete = new ArrayList<RecordInfo>(); public final List<RecordInfo> recordsToDelete = new ArrayList<>();
public boolean prepared; public boolean prepared;

View File

@ -75,7 +75,7 @@ public class JDBCSequentialFileFactoryTest {
@Test @Test
public void testCreateFiles() throws Exception { public void testCreateFiles() throws Exception {
int noFiles = 100; int noFiles = 100;
Set<String> fileNames = new HashSet<String>(); Set<String> fileNames = new HashSet<>();
for (int i = 0; i < noFiles; i++) { for (int i = 0; i < noFiles; i++) {
String fileName = UUID.randomUUID().toString() + ".txt"; String fileName = UUID.randomUUID().toString() + ".txt";
fileNames.add(fileName); fileNames.add(fileName);

View File

@ -107,7 +107,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
body = new AmqpValue(((TextMessage) msg).getText()); body = new AmqpValue(((TextMessage) msg).getText());
} }
if (msg instanceof MapMessage) { if (msg instanceof MapMessage) {
final HashMap<String, Object> map = new HashMap<String, Object>(); final HashMap<String, Object> map = new HashMap<>();
final MapMessage m = (MapMessage) msg; final MapMessage m = (MapMessage) msg;
final Enumeration<String> names = m.getMapNames(); final Enumeration<String> names = m.getMapNames();
while (names.hasMoreElements()) { while (names.hasMoreElements()) {
@ -117,7 +117,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
body = new AmqpValue(map); body = new AmqpValue(map);
} }
if (msg instanceof StreamMessage) { if (msg instanceof StreamMessage) {
ArrayList<Object> list = new ArrayList<Object>(); ArrayList<Object> list = new ArrayList<>();
final StreamMessage m = (StreamMessage) msg; final StreamMessage m = (StreamMessage) msg;
try { try {
while (true) { while (true) {
@ -163,7 +163,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
if (msg.getJMSDestination() != null) { if (msg.getJMSDestination() != null) {
props.setTo(vendor.toAddress(msg.getJMSDestination())); props.setTo(vendor.toAddress(msg.getJMSDestination()));
if (maMap == null) { if (maMap == null) {
maMap = new HashMap<Symbol, Object>(); maMap = new HashMap<>();
} }
maMap.put(JMS_DEST_TYPE_MSG_ANNOTATION, destinationType(msg.getJMSDestination())); maMap.put(JMS_DEST_TYPE_MSG_ANNOTATION, destinationType(msg.getJMSDestination()));
@ -173,7 +173,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
if (msg.getJMSReplyTo() != null) { if (msg.getJMSReplyTo() != null) {
props.setReplyTo(vendor.toAddress(msg.getJMSReplyTo())); props.setReplyTo(vendor.toAddress(msg.getJMSReplyTo()));
if (maMap == null) { if (maMap == null) {
maMap = new HashMap<Symbol, Object>(); maMap = new HashMap<>();
} }
maMap.put(JMS_REPLY_TO_TYPE_MSG_ANNOTATION, destinationType(msg.getJMSReplyTo())); maMap.put(JMS_REPLY_TO_TYPE_MSG_ANNOTATION, destinationType(msg.getJMSReplyTo()));
@ -235,14 +235,14 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
} }
else if (key.startsWith(prefixDeliveryAnnotationsKey)) { else if (key.startsWith(prefixDeliveryAnnotationsKey)) {
if (daMap == null) { if (daMap == null) {
daMap = new HashMap<Symbol, Object>(); daMap = new HashMap<>();
} }
String name = key.substring(prefixDeliveryAnnotationsKey.length()); String name = key.substring(prefixDeliveryAnnotationsKey.length());
daMap.put(Symbol.valueOf(name), msg.getObjectProperty(key)); daMap.put(Symbol.valueOf(name), msg.getObjectProperty(key));
} }
else if (key.startsWith(prefixMessageAnnotationsKey)) { else if (key.startsWith(prefixMessageAnnotationsKey)) {
if (maMap == null) { if (maMap == null) {
maMap = new HashMap<Symbol, Object>(); maMap = new HashMap<>();
} }
String name = key.substring(prefixMessageAnnotationsKey.length()); String name = key.substring(prefixMessageAnnotationsKey.length());
maMap.put(Symbol.valueOf(name), msg.getObjectProperty(key)); maMap.put(Symbol.valueOf(name), msg.getObjectProperty(key));

View File

@ -90,7 +90,7 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, Cl
private final CopyOnWriteArrayList<OpenWireConnection> connections = new CopyOnWriteArrayList<>(); private final CopyOnWriteArrayList<OpenWireConnection> connections = new CopyOnWriteArrayList<>();
private final Map<String, AMQConnectionContext> clientIdSet = new HashMap<String, AMQConnectionContext>(); private final Map<String, AMQConnectionContext> clientIdSet = new HashMap<>();
private String brokerName; private String brokerName;

View File

@ -620,9 +620,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
protected Pair<String, Set<Role>> parseSecurityRoles(final Node node) { protected Pair<String, Set<Role>> parseSecurityRoles(final Node node) {
final String match = node.getAttributes().getNamedItem("match").getNodeValue(); final String match = node.getAttributes().getNamedItem("match").getNodeValue();
HashSet<Role> securityRoles = new HashSet<>(); Set<Role> securityRoles = new HashSet<>();
Pair<String, Set<Role>> securityMatch = new Pair<String, Set<Role>>(match, securityRoles); Pair<String, Set<Role>> securityMatch = new Pair<>(match, securityRoles);
ArrayList<String> send = new ArrayList<>(); ArrayList<String> send = new ArrayList<>();
ArrayList<String> consume = new ArrayList<>(); ArrayList<String> consume = new ArrayList<>();

View File

@ -32,7 +32,7 @@ public class LivePageCacheImpl implements LivePageCache {
private static final Logger logger = Logger.getLogger(LivePageCacheImpl.class); private static final Logger logger = Logger.getLogger(LivePageCacheImpl.class);
private final List<PagedMessage> messages = new LinkedList<PagedMessage>(); private final List<PagedMessage> messages = new LinkedList<>();
private final Page page; private final Page page;

View File

@ -72,7 +72,7 @@ public class PageCursorProviderImpl implements PageCursorProvider {
private final SoftValueHashMap<Long, PageCache> softCache; private final SoftValueHashMap<Long, PageCache> softCache;
private final ConcurrentMap<Long, PageSubscription> activeCursors = new ConcurrentHashMap<Long, PageSubscription>(); private final ConcurrentMap<Long, PageSubscription> activeCursors = new ConcurrentHashMap<>();
// Static -------------------------------------------------------- // Static --------------------------------------------------------
@ -345,7 +345,7 @@ public class PageCursorProviderImpl implements PageCursorProvider {
logger.tracef("performing page cleanup %s", this); logger.tracef("performing page cleanup %s", this);
ArrayList<Page> depagedPages = new ArrayList<Page>(); ArrayList<Page> depagedPages = new ArrayList<>();
while (true) { while (true) {
if (pagingStore.lock(100)) { if (pagingStore.lock(100)) {

View File

@ -116,7 +116,7 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2 {
Set<RolePrincipal> rolesWithPermission = getPrincipalsInRole(checkType, roles); Set<RolePrincipal> rolesWithPermission = getPrincipalsInRole(checkType, roles);
// Check the caller's roles // Check the caller's roles
Set<Principal> rolesForSubject = new HashSet<Principal>(); Set<Principal> rolesForSubject = new HashSet<>();
try { try {
rolesForSubject.addAll(localSubject.getPrincipals(Class.forName(rolePrincipalClass).asSubclass(Principal.class))); rolesForSubject.addAll(localSubject.getPrincipals(Class.forName(rolePrincipalClass).asSubclass(Principal.class)));
} }

View File

@ -28,7 +28,7 @@ import org.junit.rules.ExternalResource;
* This is useful to make sure you won't have leaking threads between tests * This is useful to make sure you won't have leaking threads between tests
*/ */
public class ThreadLeakCheckRule extends ExternalResource { public class ThreadLeakCheckRule extends ExternalResource {
private static Set<String> knownThreads = new HashSet<String>(); private static Set<String> knownThreads = new HashSet<>();
boolean enabled = true; boolean enabled = true;

View File

@ -71,7 +71,7 @@ public class InMemorySchemaPartition extends AbstractLdifPartition {
// load schema // load schema
final Map<String, Boolean> resMap = ResourceMap.getResources(Pattern.compile("schema[/\\Q\\\\E]ou=schema.*")); final Map<String, Boolean> resMap = ResourceMap.getResources(Pattern.compile("schema[/\\Q\\\\E]ou=schema.*"));
for (String resourcePath : new TreeSet<String>(resMap.keySet())) { for (String resourcePath : new TreeSet<>(resMap.keySet())) {
if (resourcePath.endsWith(".ldif")) { if (resourcePath.endsWith(".ldif")) {
URL resource = DefaultSchemaLdifExtractor.getUniqueResource(resourcePath, "Schema LDIF file"); URL resource = DefaultSchemaLdifExtractor.getUniqueResource(resourcePath, "Schema LDIF file");
LdifReader reader = new LdifReader(resource.openStream()); LdifReader reader = new LdifReader(resource.openStream());

View File

@ -96,7 +96,7 @@ public class ArtemisFeatureTest extends Assert {
public static Option[] configure(String... features) { public static Option[] configure(String... features) {
ArrayList<String> f = new ArrayList<String>(); ArrayList<String> f = new ArrayList<>();
f.addAll(Arrays.asList(features)); f.addAll(Arrays.asList(features));
Option[] options = Option[] options =
@ -169,7 +169,7 @@ public class ArtemisFeatureTest extends Assert {
final Session commandSession = sessionFactory.create(System.in, printStream, printStream); final Session commandSession = sessionFactory.create(System.in, printStream, printStream);
commandSession.put("APPLICATION", System.getProperty("karaf.name", "root")); commandSession.put("APPLICATION", System.getProperty("karaf.name", "root"));
commandSession.put("USER", USER); commandSession.put("USER", USER);
FutureTask<String> commandFuture = new FutureTask<String>( FutureTask<String> commandFuture = new FutureTask<>(
new Callable<String>() { new Callable<String>() {
@Override @Override
public String call() { public String call() {
@ -246,7 +246,7 @@ public class ArtemisFeatureTest extends Assert {
} }
protected Object waitForService(String filter, long timeout) throws InvalidSyntaxException, InterruptedException { protected Object waitForService(String filter, long timeout) throws InvalidSyntaxException, InterruptedException {
ServiceTracker<Object, Object> st = new ServiceTracker<Object, Object>(bundleContext, bundleContext.createFilter(filter), null); ServiceTracker<Object, Object> st = new ServiceTracker<>(bundleContext, bundleContext.createFilter(filter), null);
try { try {
st.open(); st.open();
return st.waitForService(timeout); return st.waitForService(timeout);