[Demonstration 1]

[Buggy Method]
public static void initDept(Long deptId, int max) throws Exception {
    UserApiService userApiService = Apis.createApiService(UserApiService.class);
    DepartmentApiService departmentApiService = Apis.createApiService(DepartmentApiService.class);
    OpenApiResult<Map<String, List<DeptInfoDTO>>> result = departmentApiService.deptList(Config.context, deptId);
    List<DeptInfoDTO> deptInfo = result.getData().get("departments");
    if (deptInfo.size() > 0) {
        for (DeptInfoDTO aDeptDTO : deptInfo) {
            deptId = aDeptDTO.getDeptId();
            initDept(deptId, max);
            // 如果存在部门id=3部门，则删除部门
            if (deptId >= 3) {
                OpenApiResult<Map<String, List<UserInfoDTO>>> users = userApiService.list(Config.context, deptId);
                if (users.getData().get("users").size() > 0) {
                    for (UserInfoDTO u : users.getData().get("users")) {
                        userApiService.delete(Config.context, u.getId(), deptId);
                    }
                }
                departmentApiService.delete(Config.context, deptId);
            }
        }
    }
}

[Buggy Hunk]
if (deptId >= 3) {

[Patch]
if (deptId >= max) {

[Demonstration 2]

[Buggy Method]
public String[] getCcName() {
    if (ccName == null)
        MailTools.getCcNames(message);
    return ccName;
}

[Buggy Hunk]
MailTools.getCcNames(message);

[Patch]
ccName = MailTools.getCcNames(message);

[Demonstration 3]

[Buggy Method]
private void changeToolbarAlpha() {
    int scrollY = scrollView.getScrollY();
    int storyHeaderViewHeight = getStoryHeaderViewHeight();
    int toolbarHeight = mActionBarToolbar.getHeight();
    float contentHeight = storyHeaderViewHeight - toolbarHeight;
    float ratio = Math.min(scrollY / contentHeight, 1.0f);
    mActionBarToolbar.getBackground().setAlpha((int) (ratio * 0xFF));
    if (scrollY <= contentHeight) {
        mActionBarToolbar.setY(0f);
        return;
    }
    // Don't show toolbar if user has pulled up the whole article
    if (scrollY + scrollView.getHeight() > llWebViewContainer.getMeasuredHeight() + storyHeaderViewHeight) {
        return;
    }
    // Show the toolbar if user is pulling down
    boolean isPullingDown = mScrollPullDownHelper.onScrollChanged(scrollY);
    float toolBarPositionY = isPullingDown ? 0 : (contentHeight - scrollY);
    if (scrollY < storyHeaderViewHeight + toolbarHeight) {
        toolBarPositionY = storyHeaderViewHeight - scrollY - toolbarHeight;
    }
    mActionBarToolbar.setY(toolBarPositionY);
}

[Buggy Hunk]
mActionBarToolbar.getBackground().setAlpha((int) (ratio * 0xFF));

[Patch]
mActionBarToolbar.getBackground().mutate().setAlpha((int) (ratio * 0xFF));