if you are going to stick with testing for an initialized elderState here then
I recommend changing "initializeElderState" to return void. Then it will just
do one thing: initialize elder state. Currently it does two things: initialize
and return.
That would change this code to look something like this (if you also get rid of
the elderStateInitialized variable:
ElderState result = this.elderState;
if (result == null) {
initializeElderState();
result = this.elderState;
}
return result;
If you are okay with the method doing two things then I would change it to be a
gettor that will initialize if needed.
Then this method just does: return getElderStateInitializingIfNeeded() and the
testing of elderState would move down into that method.
These are just suggestions. I don't see anything in the current code that is
wrong.
[ Full content available at: https://github.com/apache/geode/pull/2393 ]
This message was relayed via gitbox.apache.org for [email protected]