Buggy code:
public class PrefUtils { private static final String TAG = LogUtils . makeLogTag ( "PrefUtils" ) ; public static final String PREF_LOCAL_TIMES = "pref_local_times" ; public static final String PREF_ATTENDEE_AT_VENUE = "pref_attendee_at_venue" ; public static final String PREF_DATA_BOOTSTRAP_DONE = "pref_data_bootstrap_done" ; public static final String PREF_CONFERENCE_YEAR = "pref_conference_year" ; public static final String PREF_USER_REFUSED_SIGN_IN = "pref_user_refused_sign_in" ; public static final String PREF_DEBUG_BUILD_WARNING_SHOWN = "pref_debug_build_warning_shown" ; public static final String PREF_TOS_ACCEPTED = "pref_tos_accepted" ; public static final String PREF_DECLINED_WIFI_SETUP = "pref_declined_wifi_setup" ; public static final String PREF_ANSWERED_LOCAL_OR_REMOTE = "pref_answered_local_or_remote" ; public static final String PREF_DISMISSED_IO_EXTENDED_CARD = "pref_dismissed_io_extended_card" ; public static final String PREF_BLE_ENABLED = "pref_ble_enabled" ; public static final String PREF_LAST_SYNC_ATTEMPTED = "pref_last_sync_attempted" ; public static final String PREF_LAST_SYNC_SUCCEEDED = "pref_last_sync_succeeded" ; public static final String PREF_CUR_SYNC_INTERVAL = "pref_cur_sync_interval" ; public static final String PREF_SYNC_CALENDAR = "pref_sync_calendar" ; public static final String PREF_WELCOME_DONE = "pref_welcome_done" ; public static final String PREF_ANALYTICS_ENABLED = "pref_analytics_enabled" ; public static final String PREF_SHOW_SESSION_REMINDERS = "pref_show_session_reminders" ; public static final String PREF_SHOW_SESSION_FEEDBACK_REMINDERS = "pref_show_session_feedback_reminders" ; public static TimeZone getDisplayTimeZone ( Context context ) { } public static boolean isUsingLocalTime ( Context context ) { } public static void setUsingLocalTime ( final Context context , final boolean usingLocalTime ) { } public static boolean isAttendeeAtVenue ( final Context context ) { } public static void markDataBootstrapDone ( final Context context ) { } public static boolean isDataBootstrapDone ( final Context context ) { } public static void init ( final Context context ) { } public static void setAttendeeAtVenue ( final Context context , final boolean isAtVenue ) { } public static void markUserRefusedSignIn ( final Context context ) { } public static void markUserRefusedSignIn ( final Context context , final boolean refused ) { SharedPreferences sp = PreferenceManager . getDefaultSharedPreferences ( context ) ; <START_BUG> sp . edit ( ) . putBoolean ( PrefUtils . PREF_USER_REFUSED_SIGN_IN , refused ) . commit ( ) ; <END_BUG> } public static boolean hasUserRefusedSignIn ( final Context context ) { } public static boolean wasDebugWarningShown ( final Context context ) { } public static void markDebugWarningShown ( final Context context ) { } public static boolean isTosAccepted ( final Context context ) { } public static void markTosAccepted ( final Context context ) { } public static boolean hasDeclinedWifiSetup ( Context context ) { } public static void markDeclinedWifiSetup ( final Context context ) { } public static boolean hasAnsweredLocalOrRemote ( Context context ) { } public static void markAnsweredLocalOrRemote ( final Context context ) { } public static boolean hasDismissedIOExtendedCard ( final Context context ) { } public static void markDismissedIOExtendedCard ( final Context context ) { } public static boolean hasEnabledBle ( Context context ) { } public static void setBleStatus ( final Context context , boolean status ) { } public static boolean isWelcomeDone ( final Context context ) { } public static void markWelcomeDone ( final Context context ) { } public static long getLastSyncAttemptedTime ( final Context context ) { } public static void markSyncAttemptedNow ( final Context context ) { } public static long getLastSyncSucceededTime ( final Context context ) { } public static void markSyncSucceededNow ( final Context context ) { } public static boolean shouldOfferIOExtended ( final Context context , boolean actively ) { } public static boolean isAnalyticsEnabled ( final Context context ) { } public static boolean shouldShowSessionReminders ( final Context context ) { } public static boolean shouldShowSessionFeedbackReminders ( final Context context ) { } public static long getCurSyncInterval ( final Context context ) { } public static void setCurSyncInterval ( final Context context , long interval ) { } public static boolean shouldSyncCalendar ( final Context context ) { } public static void registerOnSharedPreferenceChangeListener ( final Context context , SharedPreferences . OnSharedPreferenceChangeListener listener ) { } public static void unrgisterOnSharedPreferenceChangeListener ( final Context context , SharedPreferences . OnSharedPreferenceChangeListener listener ) { } }

Fix:
sp . edit ( ) . putBoolean ( PrefUtils . PREF_USER_REFUSED_SIGN_IN , refused ) . apply ( ) ;