Buggy code:
public abstract class TaskAbstractFragment extends Fragment { protected static final String EDIT = "edit" ; protected static final String COMPLETE = "complete" ; protected static final String CREATE = "create" ; private static final int REQUEST_CODE = 200 ; protected RelativeLayout mLayout ; protected EditText mTitleField ; protected EditText mDescriptionField ; protected TextView mAssigneeField ; protected TextView mDueDateField ; protected TextView mMiniSiteId ; protected MainActivity mParentActivity ; protected NetworkManager mNetworkManager ; private Date mDate ; private User mUser ; private MiniSite mMiniSite ; private List < User > mUsers ; private List < MiniSite > mMiniSites ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void getFieldObjects ( ) { } @ Override public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override public void onResume ( ) { } @ Override public void onCreateOptionsMenu ( Menu menu , MenuInflater inflater ) { } private void getUsers ( ) { } private void getMiniSites ( ) { } public void setButtonListeners ( ) { } private OnClickListener validateAndSubmit ( ) { } private void setEmpty ( String field , EditText editText ) { } private void openUserDialog ( ) { } private void openDateDialog ( ) { } private void openSiteDialog ( ) { } public void createTaskRequest ( Task task , final String type ) { } public void createTask ( String type , Task task ) { if ( type . equals ( TaskAbstractFragment . CREATE ) ) task = new Task ( ) ; <START_BUG> if ( task . equals ( TaskAbstractFragment . COMPLETE ) ) { <END_BUG> task . setComplete ( true ) ; createTaskRequest ( task , type ) ; return ; } task . setTitle ( mTitleField . getText ( ) . toString ( ) ) ; task . setDescription ( mDescriptionField . getText ( ) . toString ( ) ) ; task . setAssignerId ( mParentActivity . getUserId ( ) ) ; task . setDueDate ( mDate ) ; task . setAssigneeId ( mUser . getId ( ) ) ; task . setMiniSiteId ( mMiniSite . getId ( ) ) ; task . setComplete ( false ) ; createTaskRequest ( task , type ) ; } public abstract void submitListener ( ) { } public void setDate ( int year , int month , int day ) { } public void setUser ( User user ) { } public void setMiniSite ( MiniSite site ) { } public static class TaskDateDialog extends DialogFragment implements DatePickerDialog . OnDateSetListener { public static TaskAbstractFragment . TaskDateDialog newInstance ( ) { } @ Override @ NonNull public Dialog onCreateDialog ( Bundle savedInstanceState ) { } public void onDateSet ( DatePicker view , int year , int month , int day ) { } } public static class PickUserDialog extends DialogFragment { protected List < User > mUsers ; public static TaskAbstractFragment . PickUserDialog newInstance ( List < User > users ) { } @ Override @ NonNull public Dialog onCreateDialog ( Bundle savedInstanceState ) { } public String [ ] getUserNames ( ) { } private void setUsers ( List < User > users ) { } } public static class PickMiniSite extends DialogFragment { protected List < MiniSite > mMiniSites ; public static TaskAbstractFragment . PickMiniSite newInstance ( List < MiniSite > miniSites ) { } @ Override @ NonNull public Dialog onCreateDialog ( Bundle savedInstanceState ) { } public String [ ] getUserNames ( ) { } private void setUsers ( List < MiniSite > miniSites ) { } } }

Fix:
if ( type . equals ( TaskAbstractFragment . COMPLETE ) ) {