Buggy code:
public class PartnerActivity extends ProgressActivity implements View . OnClickListener , RegisterFragment . RegisterCallbacks { @ SuppressWarnings ( "unused" ) private static final String TAG = "PartnerActivity" ; private static final String ARG_CURRENT_FRAGMENT = "arg_cur_frag" ; private static final String ARG_PAIR_REGISTERED = "arg_pair_reg" ; public static final byte HEART_FRAGMENT = 0 ; public static final byte THOUGHT_FRAGMENT = 1 ; private static final float CENTER_PIVOT = 0.5F ; private BroadcastReceiver mMessageBroadcastReceiver ; private CoordinatorLayout mCoordinatorLayout ; private FloatingActionButton mFabPrimary ; private ViewPager mViewPager ; private PartnerActivity . PartnerPagerAdapter mPagerAdapter ; private LinearLayout mLinearLayoutProgress ; private TextView mTextViewProgress ; private ImageView [ ] mImageViewHearts ; private HashMap < String , Integer > mFailedMessageCount ; private String mUsername ; private String mPartnerName ; private boolean mIsPairRegistered ; private int mCurrentViewPagerPosition = 0 ; private int mCurrentFabIcon ; private int mStatusAttemptCount ; @ Override protected void onCreate ( Bundle savedInstanceState ) { } @ Override protected void onResume ( ) { } @ Override protected void onStop ( ) { } @ Override protected void onSaveInstanceState ( Bundle outState ) { } @ Override protected void onDestroy ( ) { } @ Override public void onClick ( View src ) { } @ Override public void login ( RegisterFragment . LoginCallback callback ) { } @ Override public void pairRegistered ( ) { } private void displayThoughtDialog ( ) { } private void registerMessageReceiver ( ) { } private void populateHeartImageViews ( ) { } public void deleteAccount ( ) { } @ Override public void showProgressBar ( int message ) { } @ Override public void hideProgressBar ( ) { } private void updateFloatingActionButton ( ) { } public void showFragment ( byte fragment ) { } public void sendMessage ( String message ) { } private void sendMessage ( final ParseObject messageObject , boolean statusMessage ) { } private void messageFailedToSend ( final String messageText ) { } private void setOnlineStatus ( final boolean online ) { } private void statusFetchFailed ( ) { } private void checkIfPartnerOnline ( ) { } private void superCuteHeartAnimation ( ) { } public CoordinatorLayout getCoordinatorLayout ( ) { } private final class ThoughtWatcher implements TextWatcher { private TextView mTextViewLimit ; private boolean mIsValidMessage ; private ThoughtWatcher ( TextView textViewLimit ) { } @ Override public void beforeTextChanged ( CharSequence s , int start , int count , int after ) { } @ Override public void onTextChanged ( CharSequence s , int start , int before , int count ) { } @ Override public void afterTextChanged ( Editable s ) { String input = s . toString ( ) ; <START_BUG> if ( ( input . matches ( REGEX_VALID_MESSAGE ) ) && ( mIsValidMessage ) ) { <END_BUG> mTextViewLimit . setText ( text_message_invalid_characters ) ; mTextViewLimit . setTextColor ( getResources ( ) . getColor ( error_color ) ) ; mIsValidMessage = false ; return ; } else if ( ( ( input . length ( ) ) > ( MessageUtil . MAX_MESSAGE_LENGTH ) ) && ( mIsValidMessage ) ) { mTextViewLimit . setTextColor ( getResources ( ) . getColor ( error_color ) ) ; mIsValidMessage = false ; } else if ( ( ( input . length ( ) ) <= ( MessageUtil . MAX_MESSAGE_LENGTH ) ) && ( ! ( mIsValidMessage ) ) ) { mTextViewLimit . setTextColor ( getResources ( ) . getColor ( primary_text_dark ) ) ; mIsValidMessage = true ; } mTextViewLimit . setText ( ( ( ( input . length ( ) ) + "//" ) + ( MessageUtil . MAX_MESSAGE_LENGTH ) ) ) ; } } private final class PartnerPagerAdapter extends FragmentStatePagerAdapter { private SparseArray < WeakReference < Fragment > > mRegisteredFragments = new SparseArray ( ) ; private PartnerPagerAdapter ( FragmentManager fm ) { } @ Override public Fragment getItem ( int position ) { } @ Override public Object instantiateItem ( ViewGroup container , int position ) { } @ Override public void destroyItem ( ViewGroup container , int position , Object item ) { } @ Override public int getCount ( ) { } private Fragment getFragment ( int position ) { } private Fragment getCurrentFragment ( ) { } } }

Fix:
if ( ( ! ( input . matches ( REGEX_VALID_MESSAGE ) ) ) && ( mIsValidMessage ) ) {