[Demonstration 1]

[Buggy Method]
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    if (requestCode == PERMISSIONS_REQUEST_CODE_ACCESS_COARSE_LOCATION && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
        startWiFiScan();
    } else {
        if (progressDialog != null && progressDialog.isShowing()) {
            progressDialog.dismiss();
        }
        if (!apSelectDialog.isShowing()) {
            apSelectDialog.show();
        }
    }
}

[Buggy Hunk]
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {

[Patch]
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {

[Demonstration 2]

[Buggy Method]
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    switch(requestCode) {
        case MY_PERMISSIONS_REQUEST_LOCATION:
            {
                // If request is cancelled, the result arrays are empty.
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    // permission was granted. Do the
                    // contacts-related task you need to do.
                    if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
                        if (mGoogleApiClient == null) {
                            buildGoogleApiClient();
                        }
                        mMap.setMyLocationEnabled(true);
                    }
                } else {
                    // Permission denied, Disable the functionality that depends on this permission.
                    Toast.makeText(this, "permission denied", Toast.LENGTH_LONG).show();
                }
                return;
            }
    }
}

[Buggy Hunk]
Toast.makeText(this, "permission denied", Toast.LENGTH_LONG).show();

[Patch]
Toast.makeText(this, "permission denied", Toast.LENGTH_SHORT).show();

[Demonstration 3]

[Buggy Method]
@Override
public int hashCode() {
    int result = getId();
    result = 31 * result + (getStartPoint() != null ? getStartPoint().hashCode() : 0);
    result = 31 * result + (getEndPoint() != null ? getEndPoint().hashCode() : 0);
    result = 31 * result + (getRoutesList() != null ? getRoutesList().hashCode() : 0);
    result = 31 * result + (isTraced() ? 1 : 0);
    return result;
}

[Buggy Hunk]
int result = getId();

[Patch]
int result = getId() != null ? getId().hashCode() : 0;