Java language level updates concerning Maps. (#1008)

* Java language level updates concerning Maps.

* Reverts when comments indicated no sync can happen.
This commit is contained in:
Koen De Groote
2017-04-22 15:48:46 +12:00
committed by Rob Bygrave
parent 8432f7b0d5
commit 43408fcb87
15 changed files with 20 additions and 91 deletions
@@ -4,6 +4,7 @@ import io.ebeaninternal.api.SpiTransaction;
import javax.persistence.PersistenceException;
import java.util.HashMap;
import java.util.Map;
/**
@@ -14,7 +15,7 @@ public class TransactionMap {
/**
* Map of State by serverName.
*/
private final HashMap<String, State> map = new HashMap<>();
private final Map<String, State> map = new HashMap<>();
@Override
public String toString() {
@@ -38,11 +39,7 @@ public class TransactionMap {
*/
public State getStateWithCreate(String serverName) {
State state = map.get(serverName);
if (state == null) {
state = new State();
map.put(serverName, state);
}
State state = map.computeIfAbsent(serverName, k -> new State());
return state;
}