[Demonstration 1]

[Buggy Method]
public boolean IsTransitionFinished() {
    return _god.IsVisible();
}

[Buggy Hunk]
return _god.IsVisible();

[Patch]
return _godTransition.IsTransitionFinished();

[Demonstration 2]

[Buggy Method]
private void getSchedule() {
    HashMap<String, String> mUserPassMap = new HashMap<>();
    if (tempPass == null) {
        mUserPassMap.putAll(credentials.getCredentials());
    } else {
        mUserPassMap.put("Username", credentials.getUsername());
        mUserPassMap.put("Password", tempPass);
    }
    PostLoginAPI postLoginAPI = new PostLoginAPI(MainActivity.this, new PostLoginAPI.AsyncResponse() {

        @Override
        public void processFinish(List<Shift> shiftList) {
            if (!shiftList.isEmpty()) {
                RecyclerView.Adapter mRecyclerAdapter = new RecyclerAdapter(shiftList, getApplicationContext());
                mRecyclerView.setAdapter(mRecyclerAdapter);
                addToCalendar(shiftList);
                updateSelectionColor();
                if (tempPass == null) {
                    credentials.setSchedule(shiftList);
                }
                if (importBool) {
                    importBool = false;
                    importToCalendar(shiftList);
                }
            } else if (mRecyclerView.getAdapter().getItemCount() == 0) {
                getExistingSchedule();
            }
            mSwipe.setRefreshing(false);
            importBool = false;
        }
    });
    postLoginAPI.execute(mUserPassMap);
}

[Buggy Hunk]
} else if (mRecyclerView.getAdapter().getItemCount() == 0) {

[Patch]
} else if (mRecyclerView.getAdapter() == null || mRecyclerView.getAdapter().getItemCount() == 0) {

[Demonstration 3]

[Buggy Method]
public void setAdapter(BaseRecyclerViewAdapter adapter) {
    mAdapter = adapter;
    recyclerView.setAdapter(mAdapter);
    if (mSwipeRefreshLayout != null) {
        mSwipeRefreshLayout.setRefreshing(false);
    }
    mAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {

        @Override
        public void onItemRangeChanged(int positionStart, int itemCount) {
            super.onItemRangeChanged(positionStart, itemCount);
            update();
        }

        @Override
        public void onItemRangeInserted(int positionStart, int itemCount) {
            super.onItemRangeInserted(positionStart, itemCount);
            update();
        }

        @Override
        public void onItemRangeRemoved(int positionStart, int itemCount) {
            super.onItemRangeRemoved(positionStart, itemCount);
            update();
        }

        @Override
        public void onItemRangeMoved(int fromPosition, int toPosition, int itemCount) {
            super.onItemRangeMoved(fromPosition, toPosition, itemCount);
            update();
        }

        @Override
        public void onChanged() {
            super.onChanged();
            update();
        }

        private void update() {
            isLoadingMore = false;
            if (mSwipeRefreshLayout != null) {
                mSwipeRefreshLayout.setRefreshing(false);
            }
            if (recyclerView.getAdapter().getItemCount() == 0 && mEmptyId != 0) {
                mEmpty.setVisibility(View.VISIBLE);
            } else if (mEmptyId != 0) {
                mEmpty.setVisibility(View.GONE);
            }
            if (mAdapter.getItemCount() >= showLoadMoreItemNum && mAdapter.getInfiniteScrollView() != null && mAdapter.getInfiniteScrollView().getVisibility() == View.GONE) {
                mAdapter.getInfiniteScrollView().setVisibility(View.VISIBLE);
            }
            if (mAdapter.getItemCount() < showLoadMoreItemNum && mAdapter.getInfiniteScrollView() != null) {
                mAdapter.getInfiniteScrollView().setVisibility(View.GONE);
            }
        }
    });
    if ((adapter == null || adapter.getItemCount() == 0) && mEmptyId != 0) {
        mEmpty.setVisibility(View.VISIBLE);
    }
}

[Buggy Hunk]
if ((adapter == null || adapter.getItemCount() == 0) && mEmptyId != 0) {

[Patch]
if ((mAdapter == null || mAdapter.getItemCount() == 0) && mEmptyId != 0) {