Skip to content

Commit

Permalink
Remove explicit type arguments (#1773)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 262af12f1e6f255470069cedcc5346833819bed1
  • Loading branch information
orcunc authored and actions-user committed May 3, 2024
1 parent 4002193 commit 7778c6c
Show file tree
Hide file tree
Showing 29 changed files with 37 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.hazelcast.test.HazelcastParallelClassRunner;
import com.hazelcast.test.annotation.ParallelJVMTest;
import com.hazelcast.test.annotation.QuickTest;
import org.apache.maven.plugins.shade.relocation.Relocator;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -64,8 +63,8 @@ public void setUp() throws Exception {
transformer = new HazelcastManifestTransformer();

transformer.setMainClass("com.hazelcast.core.server.HazelcastMemberStarter");
transformer.setManifestEntries(new HashMap<String, Object>());
transformer.setOverrideInstructions(new HashMap<String, String>());
transformer.setManifestEntries(new HashMap<>());
transformer.setOverrideInstructions(new HashMap<>());
}

@After
Expand All @@ -89,7 +88,7 @@ public void testHasTransformedResource() {

@Test
public void testTransformation() throws Exception {
transformer.processResource(null, is, Collections.<Relocator>emptyList());
transformer.processResource(null, is, Collections.emptyList());
transformer.modifyOutputStream(os);

verify(os).putNextEntry(any(JarEntry.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class InstructionDefinitionTest {

@Before
public void setUp() {
PackageDefinition definition = new PackageDefinition("packageName", true, "version", Collections.<String>emptySet());
PackageDefinition definition = new PackageDefinition("packageName", true, "version", Collections.emptySet());
Instruction instruction = mock(Instruction.class);

instructionDefinition = new InstructionDefinition(definition, instruction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected void equalizeBackupSizeWithPrimary(CachePartitionSegment container) {
ICacheRecordStore recordStore = iterator.next();
int totalBackupCount = recordStore.getConfig().getTotalBackupCount();
int partitionId = recordStore.getPartitionId();
toBackupSender.invokeBackupExpiryOperation(Collections.<ExpiredKey>emptyList(),
toBackupSender.invokeBackupExpiryOperation(Collections.emptyList(),
totalBackupCount, partitionId, recordStore);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ public boolean hasAnyQueryCacheRegistered() {
@SuppressWarnings("unchecked")
Collection<ListenerInfo> getListenerInfos(String cacheId) {
Collection<ListenerInfo> infos = registrations.get(cacheId);
return isEmpty(infos) ? Collections.<ListenerInfo>emptySet() : infos;
return isEmpty(infos) ? Collections.emptySet() : infos;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public enum MemberHotRestartStatus {

public ClusterHotRestartStatusDTO() {
this(FULL_RECOVERY_ONLY, ClusterHotRestartStatus.UNKNOWN, -1, -1,
Collections.<String, MemberHotRestartStatus>emptyMap());
Collections.emptyMap());
}

public ClusterHotRestartStatusDTO(HotRestartClusterDataRecoveryPolicy dataRecoveryPolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public NodeStateImpl() {

public NodeStateImpl(ClusterState clusterState, com.hazelcast.instance.impl.NodeState nodeState,
Version clusterVersion, MemberVersion memberVersion) {
this(clusterState, nodeState, clusterVersion, memberVersion, Collections.<String, List<String>>emptyMap());
this(clusterState, nodeState, clusterVersion, memberVersion, Collections.emptyMap());
}

public NodeStateImpl(ClusterState clusterState, com.hazelcast.instance.impl.NodeState nodeState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,9 @@ public Collection<Integer> getOutboundPorts(EndpointQualifier endpointQualifier)
if (advancedNetworkConfig.isEnabled()) {
EndpointConfig endpointConfig = advancedNetworkConfig.getEndpointConfigs().get(endpointQualifier);
final Collection<Integer> outboundPorts = endpointConfig != null
? endpointConfig.getOutboundPorts() : Collections.<Integer>emptyList();
? endpointConfig.getOutboundPorts() : Collections.emptyList();
final Collection<String> outboundPortDefinitions = endpointConfig != null
? endpointConfig.getOutboundPortDefinitions() : Collections.<String>emptyList();
? endpointConfig.getOutboundPortDefinitions() : Collections.emptyList();
return AddressUtil.getOutboundPorts(outboundPorts, outboundPortDefinitions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ public int size() {

/** Returns an empty Collection if argument is null. **/
public static <T> Collection<T> nullToEmpty(Collection<T> collection) {
return collection == null ? Collections.<T>emptyList() : collection;
return collection == null ? Collections.emptyList() : collection;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void testThreadLeakWhenClientCanNotConstructDueToNoMemberDiscoveryStrateg
ClientConfig config = new ClientConfig();
config.getNetworkConfig().getDiscoveryConfig().addDiscoveryStrategyConfig(
new DiscoveryStrategyConfig(new ClientDiscoverySpiTest.NoMemberDiscoveryStrategyFactory(),
Collections.<String, Comparable>emptyMap()));
Collections.emptyMap()));
config.getConnectionStrategyConfig().getConnectionRetryConfig().setClusterConnectTimeoutMillis(zeroTimeout);
Set<Thread> testStartThreads = getThreads();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testHazelcast() throws Exception {
private ClassLoader getClassLoader(String packageName) {
switch (classLoaderType) {
case FILTERING:
return new FilteringClassLoader(Collections.<String>emptyList(), packageName);
return new FilteringClassLoader(Collections.emptyList(), packageName);
case OWN:
return getClass().getClassLoader();
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testSetQueueStoreConfig() {

@Test(expected = UnsupportedOperationException.class)
public void testSetItemListenerConfigs() {
getReadOnlyConfig().setItemListenerConfigs(Collections.<ItemListenerConfig>emptyList());
getReadOnlyConfig().setItemListenerConfigs(Collections.emptyList());
}

@Test(expected = UnsupportedOperationException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testSetInMemoryFormat() {

@Test(expected = UnsupportedOperationException.class)
public void testSetListenerConfigs() {
getReadOnlyConfig().setListenerConfigs(Collections.<ListenerConfig>emptyList());
getReadOnlyConfig().setListenerConfigs(Collections.emptyList());
}

@Test(expected = UnsupportedOperationException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public void testLoadAll() {

@Test(expected = MethodNotAvailableException.class)
public void testLoadAllWithKeys() {
adapterWithLoader.loadAll(Collections.<Integer>emptySet(), true);
adapterWithLoader.loadAll(Collections.emptySet(), true);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ public void testLoadAll() {

@Test(expected = MethodNotAvailableException.class)
public void testLoadAllWithKeys() {
adapter.loadAll(Collections.<Integer>emptySet(), true);
adapter.loadAll(Collections.emptySet(), true);
}

@Test(expected = MethodNotAvailableException.class)
public void testLoadAllWithListener() {
adapter.loadAll(Collections.<Integer>emptySet(), true, null);
adapter.loadAll(Collections.emptySet(), true, null);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ public void testLoadAll() {

@Test(expected = MethodNotAvailableException.class)
public void testLoadAllWithKeys() {
adapter.loadAll(Collections.<Integer>emptySet(), true);
adapter.loadAll(Collections.emptySet(), true);
}

@Test(expected = MethodNotAvailableException.class)
public void testLoadAllWithListener() {
adapter.loadAll(Collections.<Integer>emptySet(), true, null);
adapter.loadAll(Collections.emptySet(), true, null);
}

@Test(expected = MethodNotAvailableException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private static MapConfig createMapConfig(String mapName) {
.setClassName("foo.bar.MapStoreDoesNotExist");

WanReplicationRef wanRef = new WanReplicationRef("name", "foo.bar.PolicyClass",
Collections.<String>emptyList(), true);
Collections.emptyList(), true);

EntryListenerConfig classEntryListener = new EntryListenerConfig("foo.bar.ClassName", true, true);
EntryListenerConfig entryListener = new EntryListenerConfig(new MyEntryListener(), true, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected void startIsolatedNode() {
Thread thread = Thread.currentThread();
ClassLoader tccl = thread.getContextClassLoader();
try {
FilteringClassLoader cl = new FilteringClassLoader(Collections.<String>emptyList(), "com.hazelcast");
FilteringClassLoader cl = new FilteringClassLoader(Collections.emptyList(), "com.hazelcast");
thread.setContextClassLoader(cl);

Class<?> configClazz = cl.loadClass("com.hazelcast.config.Config");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testMatchAnyInterface() {
assertTrue(AddressUtil.matchAnyInterface("10.235.194.23", asList("10.235.194.23", "10.235.193.121")));

assertFalse(AddressUtil.matchAnyInterface("10.235.194.23", null));
assertFalse(AddressUtil.matchAnyInterface("10.235.194.23", Collections.<String>emptyList()));
assertFalse(AddressUtil.matchAnyInterface("10.235.194.23", Collections.emptyList()));
assertFalse(AddressUtil.matchAnyInterface("10.235.194.23", singletonList("10.235.193.*")));
}

Expand All @@ -80,7 +80,7 @@ public void testMatchAnyDomain() {
assertTrue(AddressUtil.matchAnyDomain("hazelcast.com", singletonList("hazelcast.com")));

assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", null));
assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", Collections.<String>emptyList()));
assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", Collections.emptyList()));
assertFalse(AddressUtil.matchAnyDomain("hazelcast.com", singletonList("abc.com")));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public URL getResource(String name) {

@Override
public Enumeration<URL> getResources(String name) throws IOException {
return checkResourceExcluded(name) ? enumeration(Collections.<URL>emptyList())
return checkResourceExcluded(name) ? enumeration(Collections.emptyList())
: delegatingClassLoader.getResources(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.hazelcast.config.Config;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.internal.eviction.ExpiredKey;
import com.hazelcast.map.IMap;
import com.hazelcast.map.LocalMapStats;
import com.hazelcast.map.impl.MapService;
Expand Down Expand Up @@ -74,7 +73,7 @@ public void operation_evicts_all_replicas() {
for (int partitionId = 0; partitionId < partitionCount; partitionId++) {
for (int replicaIndex = 0; replicaIndex <= backupCount; replicaIndex++) {
EvictBatchBackupOperation operation = new EvictBatchBackupOperation(mapName,
Collections.<ExpiredKey>emptyList(), 0);
Collections.emptyList(), 0);
OperationServiceImpl operationService = getOperationService(node1);
operationService.createInvocationBuilder(MapService.SERVICE_NAME, operation, partitionId)
.setReplicaIndex(replicaIndex).invoke().join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void setUp() {
batchEventDataOtherSource = new BatchEventData(events, "otherSource", 1);
batchEventDataOtherPartitionId = new BatchEventData(events, "source", 2);
batchEventDataOtherEvent = new BatchEventData(singleton(otherEventData), "source", 1);
batchEventDataNoEvent = new BatchEventData(Collections.<QueryCacheEventData>emptyList(), "source", 1);
batchEventDataNoEvent = new BatchEventData(Collections.emptyList(), "source", 1);
}

private DefaultQueryCacheEventData prepareDefaultQueryCacheEventDataWithMapName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class BatchIMapEventTest {

@Before
public void setUp() throws Exception {
batchEventData = new BatchEventData(Collections.<QueryCacheEventData>emptyList(), "source", 1);
batchEventData = new BatchEventData(Collections.emptyList(), "source", 1);

batchIMapEvent = new BatchIMapEvent(batchEventData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void size_nonMatchingPredicate() {
public void size_matchingPredicate_notInResult() {
Set<QueryableEntry> entries = generateEntries(100000);
List<Set<QueryableEntry>> otherIndexedResults = new ArrayList<>();
otherIndexedResults.add(Collections.<QueryableEntry>emptySet());
otherIndexedResults.add(Collections.emptySet());
AndResultSet resultSet = new AndResultSet(entries, otherIndexedResults, asList(Predicates.alwaysTrue()));

int size = resultSet.size();
Expand Down Expand Up @@ -138,7 +138,7 @@ public void contains_nonMatchingPredicate() {
public void contains_matchingPredicate_notInResult() {
Set<QueryableEntry> entries = generateEntries(100000);
List<Set<QueryableEntry>> otherIndexedResults = new ArrayList<>();
otherIndexedResults.add(Collections.<QueryableEntry>emptySet());
otherIndexedResults.add(Collections.emptySet());
AndResultSet resultSet = new AndResultSet(entries, otherIndexedResults, asList(Predicates.alwaysTrue()));

assertNotContains(resultSet, entries.iterator().next());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.hazelcast.security;

import com.hazelcast.config.PermissionConfig;
import com.hazelcast.config.SecurityConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.test.HazelcastParallelClassRunner;
Expand Down Expand Up @@ -58,6 +57,6 @@ public void testUpdate_whenSecurityNotEnabled() {
SecurityConfig securityConfig = hz.getConfig().getSecurityConfig();

exception.expect(UnsupportedOperationException.class);
securityConfig.setClientPermissionConfigs(Collections.<PermissionConfig>emptySet());
securityConfig.setClientPermissionConfigs(Collections.emptySet());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ public void noBreakingChangeInPartitionGroupStrategyAbstractClass() {

static class TestBreakingChangesDiscoveryStrategy extends AbstractDiscoveryStrategy {
TestBreakingChangesDiscoveryStrategy() {
super(null, Collections.<String, Comparable>emptyMap());
super(null, Collections.emptyMap());
}

@Override
Expand Down Expand Up @@ -844,7 +844,7 @@ private static Config getDiscoverySPIConfig(String xmlFileName, boolean isDeprec
DiscoveryConfig discoveryConfig = config.getNetworkConfig().getJoin().getDiscoveryConfig();
discoveryConfig.getDiscoveryStrategyConfigs().clear();

DiscoveryStrategyConfig strategyConfig = new DiscoveryStrategyConfig(factory, Collections.<String, Comparable>emptyMap());
DiscoveryStrategyConfig strategyConfig = new DiscoveryStrategyConfig(factory, Collections.emptyMap());
discoveryConfig.addDiscoveryStrategyConfig(strategyConfig);
return config;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void destroy() {
private abstract static class ExtendableDiscoveryStrategy extends AbstractDiscoveryStrategy {

ExtendableDiscoveryStrategy() {
super(null, Collections.<String, Comparable>emptyMap());
super(null, Collections.emptyMap());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected void initClockOffsetTest(long offsetMillis) {
System.setProperty(ClockProperties.HAZELCAST_CLOCK_OFFSET, String.valueOf(offsetMillis));
Thread thread = currentThread();
tccl = thread.getContextClassLoader();
filteringClassloader = new FilteringClassLoader(Collections.<String>emptyList(), "com.hazelcast");
filteringClassloader = new FilteringClassLoader(Collections.emptyList(), "com.hazelcast");
thread.setContextClassLoader(filteringClassloader);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class MockNodeContext implements NodeContext {
private final List<String> nodeExtensionPriorityList;

public MockNodeContext(TestNodeRegistry registry, Address thisAddress) {
this(registry, thisAddress, Collections.<Address>emptySet(), DefaultNodeContext.EXTENSION_PRIORITY_LIST);
this(registry, thisAddress, Collections.emptySet(), DefaultNodeContext.EXTENSION_PRIORITY_LIST);
}

protected MockNodeContext(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public TestNodeRegistry(Collection<Address> addresses, List<String> nodeExtensio
}

public NodeContext createNodeContext(Address address) {
return createNodeContext(address, Collections.<Address>emptySet());
return createNodeContext(address, Collections.emptySet());
}

public NodeContext createNodeContext(final Address address, Set<Address> initiallyBlockedAddresses) {
Expand Down

0 comments on commit 7778c6c

Please sign in to comment.