Permalink
Browse files

Fixed a type cast bug

  • Loading branch information...
1 parent 165b572 commit 67f5c8d79f0a70cd360d66ae568cb43ffd6bf6b0 @janpaul123 janpaul123 committed Apr 11, 2011
Showing with 4 additions and 3 deletions.
  1. +1 −1 Main.java
  2. +3 −2 RemoteCache.java
View
@@ -29,7 +29,7 @@ public Main(String[] args)
serverNames.add(scanner.nextLine());
}
- cache = new RemoteCache((String[])serverNames.toArray(), Integer.parseInt(args[2]), new BasicCache(Integer.parseInt(args[3])));
+ cache = new RemoteCache(serverNames, Integer.parseInt(args[2]), new BasicCache(Integer.parseInt(args[3])));
} catch (Exception e) {
e.printStackTrace();
System.err.println("Using basic cache...");
View
@@ -1,17 +1,18 @@
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
+import java.util.Vector;
public class RemoteCache implements ICache
{
CacheServer cache;
HashBalancer hb;
- public RemoteCache(String[] serverNames, int localId, ICache localCache)
+ public RemoteCache(Vector<String> serverNames, int localId, ICache localCache)
{
try {
cache = new CacheServer(localCache);
- Naming.rebind(serverNames[localId], cache);
+ Naming.rebind(serverNames.get(localId), cache);
hb = new HashBalancer(serverNames);
} catch (RemoteException e) {
e.printStackTrace();

0 comments on commit 67f5c8d

Please sign in to comment.