I do some initialization in Spring singleton bean @PostConstruct method (simplified code):
@Component
public class Env {
public String currentEnv;
@PostConstruct
public void init() {
currentEnv = "dev";
}
}
Should I worry about currentEnv visibility to other beans(other thread) and mark it volatile.