I have this setHash
function that is asynchronous:
public void setHash(Context context, String hash) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putString("has", hash);
editor.apply();
}
I use it with the following code:
private String mHash = "s4mp1eh45h";
void myFunction() {
setHash(this, mHash);
mHash = null;
}
I know that java is 'pass-by-value' per this post. Now my question is, is there a chance that the hash that gets saved in my setHash
function is null?