Remove redundant type arguments
This commit is contained in:
parent
560ba1b39b
commit
33a51223b0
|
@ -474,7 +474,7 @@ public class URISupport {
|
|||
if (options.size() > 0) {
|
||||
StringBuilder rc = new StringBuilder();
|
||||
boolean first = true;
|
||||
List<String> keys = new ArrayList<String>();
|
||||
List<String> keys = new ArrayList<>();
|
||||
keys.addAll(options.keySet());
|
||||
Collections.sort(keys);
|
||||
for (String key : keys) {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class URIParserTest {
|
|||
|
||||
@Test
|
||||
public void testQueryConversion() throws Exception {
|
||||
Map<String, String> query = new HashMap<String, String>();
|
||||
Map<String, String> query = new HashMap<>();
|
||||
String queryString = URISupport.createQueryString(query);
|
||||
System.out.println("queryString1: " + queryString);
|
||||
Assert.assertTrue(queryString.isEmpty());
|
||||
|
|
|
@ -30,9 +30,9 @@ final class TransactionHolder {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class JDBCSequentialFileFactoryTest {
|
|||
@Test
|
||||
public void testCreateFiles() throws Exception {
|
||||
int noFiles = 100;
|
||||
Set<String> fileNames = new HashSet<String>();
|
||||
Set<String> fileNames = new HashSet<>();
|
||||
for (int i = 0; i < noFiles; i++) {
|
||||
String fileName = UUID.randomUUID().toString() + ".txt";
|
||||
fileNames.add(fileName);
|
||||
|
|
|
@ -107,7 +107,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
|
|||
body = new AmqpValue(((TextMessage) msg).getText());
|
||||
}
|
||||
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 Enumeration<String> names = m.getMapNames();
|
||||
while (names.hasMoreElements()) {
|
||||
|
@ -117,7 +117,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
|
|||
body = new AmqpValue(map);
|
||||
}
|
||||
if (msg instanceof StreamMessage) {
|
||||
ArrayList<Object> list = new ArrayList<Object>();
|
||||
ArrayList<Object> list = new ArrayList<>();
|
||||
final StreamMessage m = (StreamMessage) msg;
|
||||
try {
|
||||
while (true) {
|
||||
|
@ -163,7 +163,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
|
|||
if (msg.getJMSDestination() != null) {
|
||||
props.setTo(vendor.toAddress(msg.getJMSDestination()));
|
||||
if (maMap == null) {
|
||||
maMap = new HashMap<Symbol, Object>();
|
||||
maMap = new HashMap<>();
|
||||
}
|
||||
maMap.put(JMS_DEST_TYPE_MSG_ANNOTATION, destinationType(msg.getJMSDestination()));
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class JMSMappingOutboundTransformer extends OutboundTransformer {
|
|||
if (msg.getJMSReplyTo() != null) {
|
||||
props.setReplyTo(vendor.toAddress(msg.getJMSReplyTo()));
|
||||
if (maMap == null) {
|
||||
maMap = new HashMap<Symbol, Object>();
|
||||
maMap = new HashMap<>();
|
||||
}
|
||||
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)) {
|
||||
if (daMap == null) {
|
||||
daMap = new HashMap<Symbol, Object>();
|
||||
daMap = new HashMap<>();
|
||||
}
|
||||
String name = key.substring(prefixDeliveryAnnotationsKey.length());
|
||||
daMap.put(Symbol.valueOf(name), msg.getObjectProperty(key));
|
||||
}
|
||||
else if (key.startsWith(prefixMessageAnnotationsKey)) {
|
||||
if (maMap == null) {
|
||||
maMap = new HashMap<Symbol, Object>();
|
||||
maMap = new HashMap<>();
|
||||
}
|
||||
String name = key.substring(prefixMessageAnnotationsKey.length());
|
||||
maMap.put(Symbol.valueOf(name), msg.getObjectProperty(key));
|
||||
|
|
|
@ -90,7 +90,7 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, Cl
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -620,9 +620,9 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
|
|||
protected Pair<String, Set<Role>> parseSecurityRoles(final Node node) {
|
||||
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> consume = new ArrayList<>();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class LivePageCacheImpl implements LivePageCache {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public class PageCursorProviderImpl implements PageCursorProvider {
|
|||
|
||||
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 --------------------------------------------------------
|
||||
|
||||
|
@ -345,7 +345,7 @@ public class PageCursorProviderImpl implements PageCursorProvider {
|
|||
|
||||
logger.tracef("performing page cleanup %s", this);
|
||||
|
||||
ArrayList<Page> depagedPages = new ArrayList<Page>();
|
||||
ArrayList<Page> depagedPages = new ArrayList<>();
|
||||
|
||||
while (true) {
|
||||
if (pagingStore.lock(100)) {
|
||||
|
|
|
@ -116,7 +116,7 @@ public class ActiveMQJAASSecurityManager implements ActiveMQSecurityManager2 {
|
|||
Set<RolePrincipal> rolesWithPermission = getPrincipalsInRole(checkType, roles);
|
||||
|
||||
// Check the caller's roles
|
||||
Set<Principal> rolesForSubject = new HashSet<Principal>();
|
||||
Set<Principal> rolesForSubject = new HashSet<>();
|
||||
try {
|
||||
rolesForSubject.addAll(localSubject.getPrincipals(Class.forName(rolePrincipalClass).asSubclass(Principal.class)));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.junit.rules.ExternalResource;
|
|||
* This is useful to make sure you won't have leaking threads between tests
|
||||
*/
|
||||
public class ThreadLeakCheckRule extends ExternalResource {
|
||||
private static Set<String> knownThreads = new HashSet<String>();
|
||||
private static Set<String> knownThreads = new HashSet<>();
|
||||
|
||||
boolean enabled = true;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class InMemorySchemaPartition extends AbstractLdifPartition {
|
|||
|
||||
// load 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")) {
|
||||
URL resource = DefaultSchemaLdifExtractor.getUniqueResource(resourcePath, "Schema LDIF file");
|
||||
LdifReader reader = new LdifReader(resource.openStream());
|
||||
|
|
|
@ -96,7 +96,7 @@ public class ArtemisFeatureTest extends Assert {
|
|||
|
||||
public static Option[] configure(String... features) {
|
||||
|
||||
ArrayList<String> f = new ArrayList<String>();
|
||||
ArrayList<String> f = new ArrayList<>();
|
||||
f.addAll(Arrays.asList(features));
|
||||
|
||||
Option[] options =
|
||||
|
@ -169,7 +169,7 @@ public class ArtemisFeatureTest extends Assert {
|
|||
final Session commandSession = sessionFactory.create(System.in, printStream, printStream);
|
||||
commandSession.put("APPLICATION", System.getProperty("karaf.name", "root"));
|
||||
commandSession.put("USER", USER);
|
||||
FutureTask<String> commandFuture = new FutureTask<String>(
|
||||
FutureTask<String> commandFuture = new FutureTask<>(
|
||||
new Callable<String>() {
|
||||
@Override
|
||||
public String call() {
|
||||
|
@ -246,7 +246,7 @@ public class ArtemisFeatureTest extends Assert {
|
|||
}
|
||||
|
||||
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 {
|
||||
st.open();
|
||||
return st.waitForService(timeout);
|
||||
|
|
Loading…
Reference in New Issue