summaryrefslogtreecommitdiff
path: root/same
diff options
context:
space:
mode:
Diffstat (limited to 'same')
-rw-r--r--same/src/main/java/com/orbekk/same/Client.java5
-rw-r--r--same/src/main/java/com/orbekk/same/Master.java2
-rw-r--r--same/src/test/java/com/orbekk/same/ClientTest.java2
3 files changed, 5 insertions, 4 deletions
diff --git a/same/src/main/java/com/orbekk/same/Client.java b/same/src/main/java/com/orbekk/same/Client.java
index b210b6b..53d0ac8 100644
--- a/same/src/main/java/com/orbekk/same/Client.java
+++ b/same/src/main/java/com/orbekk/same/Client.java
@@ -103,7 +103,8 @@ public class Client {
listener.stateChanged(state.getComponent(component));
}
} else {
- logger.warn("Ignoring update: {}",
+ logger.warn("Ignoring update: {) => {}",
+ state.getComponent(component),
new State.Component(component, revision, data));
}
}
@@ -261,7 +262,7 @@ public class Client {
} catch (CancellationException e) {
}
if (!currentMasterProposal.isCancelled() && result != null) {
- masterController.enableMaster(state, result);
+ masterController.enableMaster(new State(state), result);
}
}
diff --git a/same/src/main/java/com/orbekk/same/Master.java b/same/src/main/java/com/orbekk/same/Master.java
index 529d729..6041cf1 100644
--- a/same/src/main/java/com/orbekk/same/Master.java
+++ b/same/src/main/java/com/orbekk/same/Master.java
@@ -13,7 +13,7 @@ public class Master {
private String myUrl;
State state;
private Broadcaster broadcaster;
- private volatile int masterId = 0;
+ private volatile int masterId = 1;
public static Master create(ConnectionManager connections,
Broadcaster broadcaster, String myUrl, String networkName) {
diff --git a/same/src/test/java/com/orbekk/same/ClientTest.java b/same/src/test/java/com/orbekk/same/ClientTest.java
index 0e2a278..6c617be 100644
--- a/same/src/test/java/com/orbekk/same/ClientTest.java
+++ b/same/src/test/java/com/orbekk/same/ClientTest.java
@@ -33,7 +33,7 @@ public class ClientTest {
}
@Test public void connectedUpdateWorks() throws Exception {
- clientS.masterTakeover("master", null, 0);
+ clientS.masterTakeover("master", null, 1);
ClientInterface clientI = client.getInterface();
State.Component component = new State.Component(
"TestVariable", 1, "meow");