This doesn\'t compile and gives the following error : Illegal start of expression. Why?
Illegal start of expression
public static AppConfig getInstance() { return mConf
In case it's helpful to someone, here is an answer using java 8+ Optional:
public static AppConfig getInstance() { return Optional.ofNullable(mConfig).orElseThrow(() -> new RuntimeException("error")); }