java - Modifying member variable causes line to be skipped
<p><strong>Closing</strong> It looks like it's related to the IDE (Eclipse). I built a separate class with the same code and different name and it works fine. Tried cleaning, restarting etc. Ugh.</p>

<p><strong>Updated test code</strong> I'm stumped here and I'm guessing it's something stupid. I've whittled my code down to this which reproduces the issue.</p>

<p>This executes <code>mMemberVar = 2;</code> and then causes the <code>return now.add(Calendar.DAY_OF_YEAR, 1);</code> to be skipped. It then skips to <code>return null;</code></p>

<p>Is this caused by it being <code>Serializable</code> and something strange with modifying it's own member variables? I can't find anything on it.</p>

<pre><code>public class Alarm implements Serializable {
    int mMemberVar = 0;
    public Calendar nextTime() {
        Calendar now = Calendar.getInstance();
        if (true) {
            if (true) {
                if (true) {
                    mMemberVar = 2;
                    // return is skipped
                    now.add(Calendar.DAY_OF_YEAR, 1);
                    return now;
                }
            }
            now.add(Calendar.DAY_OF_YEAR, 2);
            return now;
        }
        return null;
    }
}
</code></pre>
