String c = sc.next().trim();
if(c.equals("c")){
//TODO: request access here!
System.out.println("starting two phase commit.");
coordinator.startCommit();
}else if(c.equals("e")){
System.out.println("exiting..");
sc.close();
lt.finish();
return;
}else if(c.equals("c")){
System.out.println("Active clients:");
for (Map.Entry<Socket, Participant> entry : connections.entrySet()) {
System.out.println(entry.getValue());
}
}else{
System.out.println("unrecognized command.");
}
Here are two same if statements "c.equals("c")", which I think is a bug.
Reactions are currently unavailable
String c = sc.next().trim(); if(c.equals("c")){ //TODO: request access here! System.out.println("starting two phase commit."); coordinator.startCommit(); }else if(c.equals("e")){ System.out.println("exiting.."); sc.close(); lt.finish(); return; }else if(c.equals("c")){ System.out.println("Active clients:"); for (Map.Entry<Socket, Participant> entry : connections.entrySet()) { System.out.println(entry.getValue()); } }else{ System.out.println("unrecognized command."); }Here are two same if statements "c.equals("c")", which I think is a bug.