Skip to content

Commit

Permalink
GEODE-2007: fix unchecked warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklund committed Oct 17, 2016
1 parent 7330733 commit a53c4b1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ public void fromData(DataInput in) throws IOException, ClassNotFoundException {
}
}

@SuppressWarnings({"unchecked", "rawtypes"})
protected ConcurrentMap readInAttributes(final DataInput in) throws IOException, ClassNotFoundException {
protected ConcurrentMap<String, Object> readInAttributes(final DataInput in) throws IOException, ClassNotFoundException {
return DataSerializer.readObject(in);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.apache.geode.distributed.ConfigurationProperties.*;
import static org.apache.geode.internal.cache.CacheServerLauncher.serverPort;

import java.util.List;
import java.util.Properties;

import org.junit.experimental.categories.Category;
Expand Down Expand Up @@ -49,7 +50,7 @@ public void postSetUp() throws Exception {
@Override
public void preTearDown() {
vm0.invoke(() -> {
GemFireCacheImpl.getInstance().getCacheServers().forEach(e -> ((CacheServer)e).stop());
(GemFireCacheImpl.getInstance().getCacheServers()).forEach(cacheServer -> cacheServer.stop());
});
server.stopContainer();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4015,7 +4015,7 @@ public void setGatewayConflictResolver(GatewayConflictResolver resolver) {
}
}

public List getCacheServers() {
public List<CacheServer> getCacheServers() {
List cacheServersWithoutReceiver = null;
if (!allCacheServers.isEmpty()) {
Iterator allCacheServersIterator = allCacheServers.iterator();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.geode.cache.query.internal.CqQueryVsdStats;
import org.apache.geode.cache.query.internal.cq.CqService;
import org.apache.geode.cache.query.internal.cq.InternalCqQuery;
import org.apache.geode.cache.server.CacheServer;
import org.apache.geode.cache.util.CacheListenerAdapter;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.distributed.internal.DM;
Expand Down Expand Up @@ -2987,10 +2988,10 @@ public void run() {
&& !queueRemovalMessageList.isEmpty()) { // messages exist
QueueRemovalMessage qrm = new QueueRemovalMessage();
qrm.resetRecipients();
List<CacheServerImpl> servers = this.cache.getCacheServers();
List<CacheServer> servers = this.cache.getCacheServers();
List<DistributedMember> recipients = new LinkedList();
for (CacheServerImpl server: servers) {
recipients.addAll(server.getCacheServerAdvisor().adviseBridgeServers());
for (CacheServer server: servers) {
recipients.addAll(CacheServerImpl.class.cast(server).getCacheServerAdvisor().adviseBridgeServers());
}
qrm.setRecipients(recipients);
qrm.setMessagesList(queueRemovalMessageList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ public boolean done() {

public static void verifyFullValueRequestsFromClients(Long expected)
throws Exception {
List<CacheServerImpl> servers = ((GemFireCacheImpl)cache).getCacheServers();
List<CacheServer> servers = ((GemFireCacheImpl)cache).getCacheServers();
assertEquals("expected one server but found these: " + servers, 1, servers.size());

CacheClientProxy[] proxies = servers.get(0).getAcceptor().getCacheClientNotifier()
CacheClientProxy[] proxies = CacheServerImpl.class.cast(servers.get(0)).getAcceptor().getCacheClientNotifier()
.getClientProxies().toArray(new CacheClientProxy[0]);

// find the proxy for the client that processed the CQs - it will have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ private void convertThrowableForOldClient(String geodeClassName) throws Exceptio
}
}

private Object instantiate(Class aClass) throws Exception {
Constructor c = null;
private Object instantiate(Class<?> aClass) throws Exception {
Constructor<?> c = null;
try {
c = aClass.getConstructor();
return c.newInstance();
Expand Down

0 comments on commit a53c4b1

Please sign in to comment.