package org.wikipedia.login;

import org.wikipedia.settings.Prefs;

public class UserInfoStorage {
    private User currentUser;

    public boolean isLoggedIn() {
        return getUser() != null;
    }

    public void setUser(User user) {
        Prefs.setLoginUsername(user.getUsername());
        Prefs.setLoginPassword(user.getPassword());
        Prefs.setLoginUserId(user.getUserID());
    }

    public User getUser() {
        if (currentUser == null) {
            if (Prefs.hasLoginUsername() && Prefs.hasLoginPassword()) {
                currentUser = new User(
                        Prefs.getLoginUsername(),
                        Prefs.getLoginPassword(),
                        Prefs.getLoginUserId()
                );
            }
        }

        return currentUser;
    }

    public void clearUser() {
        Prefs.removeLoginUsername();
        Prefs.removeLoginPassword();
        Prefs.removeLoginUserId();
        currentUser = null;
    }

}

@@ -23,16 +23,61 @@
 login;%0A%0A
+import android.support.annotation.Nullable;%0A%0A
 import o
@@ -431,32 +431,46 @@
 erID());%0A    %7D%0A%0A
+    @Nullable%0A
     public User 

add missing @Nullable annotation