diff --git a/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java b/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java index b437dc4d7f..ee2c1f005a 100644 --- a/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java +++ b/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java @@ -8,8 +8,6 @@ import java.util.Map; import javax.annotation.PostConstruct; import javax.ejb.ConcurrencyManagement; import javax.ejb.ConcurrencyManagementType; -import javax.ejb.Lock; -import javax.ejb.LockType; import javax.ejb.Singleton; import javax.ejb.Startup; @@ -18,7 +16,7 @@ import javax.ejb.Startup; @ConcurrencyManagement(ConcurrencyManagementType.BEAN) public class CountryStateBeanManagedBean implements CountryState { - private volatile Map> countryStatesMap = new HashMap>(); + private final Map> countryStatesMap = new HashMap>(); @PostConstruct public synchronized void initialize() {