Buggy code:
private static final String TAG = "CombatMap" ; private static MapData mData ; private static final int MODE_DRAW_ANNOTATIONS = 3 ; private static final int MODE_DRAW_BACKGROUND = 1 ; private static final int MODE_DRAW_GM_NOTES = 4 ; private static final int MODE_TOKENS = 2 ; private static final int REQUEST_PICK_BACKGROUND_IMAGE = 0 ; private String mAttemptedMapName ; private FrameLayout mBottomControlFrame ; private CombatView mCombatView ; private DrawOptionsView mDrawOptionsView ; private Text mEditedTextObject ; private boolean mIsControlTrayExpanded = true ; private ActionMode mActionMode ; private PointF mNewObjectLocationWorldSpace ; private ToggleButton mMeasuringToggle ; int mUndoMenuItemDrawable = drawable . undo ; int mRedoMenuItemDrawable = drawable . redo ; private final OnChangeDrawToolListener mOnChangeDrawToolListener = new OnChangeDrawToolListener ( ) { @ Override public void onChangeMaskEditing ( boolean editingMask ) { } @ Override public void onChooseCircleTool ( ) { } @ Override public void onChooseColoredPen ( final int color ) { } @ Override public void onChooseEraser ( ) { } @ Override public void onChooseFreeHandTool ( ) { } @ Override public void onChooseImageTool ( ) { } @ Override public void onChooseMaskEraser ( ) { } @ Override public void onChooseMaskTool ( ) { } @ Override public void onChoosePanTool ( ) { } @ Override public void onChooseRectangleTool ( ) { } @ Override public void onChooseStraightLineTool ( ) { } @ Override public void onChooseStrokeWidth ( final float width ) { } @ Override public void onChooseTextTool ( ) { } @ Override public void onChooseInfoTool ( ) { } @ Override public void onChooseMoveTokenTool ( ) { } } ; private final ActivityRequestListener mOnNewTextEntryListener = new CombatView . ActivityRequestListener ( ) { @ Override public void requestEditTextObject ( OnScreenText t ) { } @ Override public void requestNewTextEntry ( PointF newTextLocationWorldSpace ) { } @ Override public void requestNewBackgroundImage ( PointF locationWorldSpace ) { } @ Override public void requestNewInfoEntry ( PointF locationWorldSpace ) { } @ Override public void requestEditInfoObject ( Information information ) { } } ; private final TagSelectedListener mTagSelectedListener = new TagNavigator . TagSelectedListener ( ) { @ Override public void onTagSelected ( TagTreeNode selectedTag ) { } @ Override public void onDragTokensToTag ( Collection < BaseToken > token , TagTreeNode tag ) { } } ; private final ImageSelectionListener mOnImageSelectListener = new CombatView . ImageSelectionListener ( ) { @ Override public void onSelectNoBackgroundImage ( ) { } @ Override public void onSelectBackgroundImage ( BackgroundImage selectedImage ) { } } ; private final OnTokenSelectedListener mOnTokenSelectedListener = new TokenSelectorView . OnTokenSelectedListener ( ) { @ Override public void onTokenSelected ( final BaseToken t ) { } } ; private View mPopupFrame ; private MenuItem mRedoMenuItem ; private MenuItem mSaveMenuItem ; private MenuItem mViewMenuItem ; private SharedPreferences mSharedPreferences ; private MenuItem mSnapToGridMenuItem ; private MenuItem mRestoreViewMenuItem ; private MenuItem mCastViewMenuItem ; private MenuItem mStopCastingViewMenuItem ; private TabManager mTabManager ; private final TabSelectedListener mTabSelectedListener = new TabManager . TabSelectedListener ( ) { @ Override public void onTabSelected ( int tab ) { } } ; private boolean mTagSelectorVisible ; private TagNavigator mTagNavigator ; private TokenDatabase mTokenDatabase ; private TokenSelectorView mTokenSelector ; private MenuItem mUndoMenuItem ; private Button mDeployTokensButton ; private Loader mLoader ; private TextView mSelectedToolTextView ; private CastManager mCastManager ; private int mOldBottomControlFrameHeight ; private int lastUsedTheme = - 1 ; private String getModeSpecificSnapPreferenceName ( final int mode ) { } public void loadMap ( final String name ) { String errorString = new DataManager ( this . getApplicationContext ( ) ) . loadMapName ( name ) ; <START_BUG> if ( errorString != null ) { <END_BUG> if ( ( this . getApplicationContext ( ) ) != null ) { Toast toast = Toast . makeText ( this . getApplicationContext ( ) , ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>load<seq2seq4repair_space>file.<seq2seq4repair_space>Reason:<seq2seq4repair_space>" + errorString ) , LENGTH_LONG ) ; toast . show ( ) ; } this . setFilenamePreference ( null ) ; MapData . clear ( ) ; reportBadMap ( name , errorString ) ; } CombatMap . mData = MapData . getInstance ( ) ; if ( ( mCombatView ) != null ) { this . mCombatView . setData ( CombatMap . mData ) ; } if ( ( mTagNavigator ) != null ) { this . mTagNavigator . setTagPath ( CombatMap . mData . getLastTag ( ) ) ; } } private void reportBadMap ( String mapName , final String errorString ) { } @ Override protected void onActivityResult ( final int requestCode , final int resultCode , final Intent data ) { } private void loadModePreference ( ) { } private void loadModeSpecificSnapPreference ( ) { } private void loadOrCreateMap ( ) { } @ Override public void onCreate ( final Bundle savedInstanceState ) { } @ Override public void onConfigurationChanged ( Configuration newConfig ) { } private void initializeUi ( ) { } @ TargetApi ( VERSION_CODES . LOLLIPOP ) private void setElevations ( ) { } private void exportToChromecast ( ) { } @ Override public Dialog onCreateDialog ( final int id ) { } @ TargetApi ( VERSION_CODES . LOLLIPOP ) private void setCorrectTheme ( ) { } @ TargetApi ( VERSION_CODES . LOLLIPOP ) private void styleActionBar ( ) { } private void setTitle ( ) { } @ Override public boolean onCreateOptionsMenu ( final Menu menu ) { } @ Override public boolean onOptionsItemSelected ( final MenuItem item ) { } @ Override public void onPause ( ) { } @ Override public void onDestroy ( ) { } @ Override protected void onPrepareDialog ( final int id , @ Nonnull final Dialog dialog ) { } @ Override public void onResume ( ) { } private void maybeShowImportPromo ( ) { } private void reloadPreferences ( ) { } private void setFilenamePreference ( final String newFilename ) { } @ TargetApi ( VERSION_CODES . GINGERBREAD ) private void savePrefChanges ( Editor editor ) { } private void setManipulationMode ( final int manipulationMode ) { } private void setModePreference ( final int mode ) { } private void setModeSpecificSnapPreference ( final boolean shouldSnap ) { }

Fix:
if ( ( errorString != null ) || ( errorString . isEmpty ( ) ) ) {