[Demonstration 1]

[Buggy Method]
@Test
public void testMaybeNull_negative() throws Exception {
    long input = -1;
    Long result = SqlUtils.maybeNull(input);
    assertNull(result);
}

[Buggy Hunk]
assertNull(result);

[Patch]
assertEquals(Long.valueOf(input), result);

[Demonstration 2]

[Buggy Method]
@Override
public void updateAverageStepperiod(int period) {
    stepPeriodView.setText(getString(R.string.step_setup_average_stepperiod) + " " + period);
}

[Buggy Hunk]
stepPeriodView.setText(getString(R.string.step_setup_average_stepperiod) + " " + period);

[Patch]
stepPeriodView.setText(getString(R.string.step_setup_average_stepperiod) + " " + period + " ms");

[Demonstration 3]

[Buggy Method]
@RequestMapping(value = "editshippingdays", method = RequestMethod.POST)
@ResponseBody
public Result editShippingDays(@RequestParam(value = "id", required = true) int id, @RequestParam(value = "shippingDays", required = true) int shippingDays) {
    Result result = new Result();
    if (updateLock) {
        logger.debug("simultaniously called!");
        result.setName(Result.FAILED);
        result.setDescription("being simultaniously called!");
        return result;
    }
    // set lock
    updateLock = true;
    try {
        NG_Channel channel = ng_channelDao.get(id);
        if (channel.getPlattform_name().contains("ebay")) {
            boolean successful = false;
            successful = EBayUtil.changeShippingDays(channel, shippingDays);
            if (successful) {
                try {
                    String[] ids = channel.getPlattform_id().split("-");
                    String itemId = ids[0];
                    List<NG_Channel> channels = ng_channelDao.listVariationChannels(itemId);
                    for (NG_Channel vChannel : channels) {
                        vChannel.setShippingDays(shippingDays);
                        ng_channelDao.save(vChannel);
                        logger.debug("changed shippingDays " + channel.getPlattform_id() + " " + channel.getShippingDays());
                    }
                } catch (Exception e) {
                    throw new RuntimeException("plattformId format is incorrect! " + channel.getPlattform_id());
                }
            } else {
                result.setName(Result.FAILED);
                result.setDescription("failed to change quantity");
                return result;
            }
        } else {
            channel.setShippingDays(shippingDays);
            ng_channelDao.save(channel);
        }
        // return result
        result.setName(Result.SUCCESSFUL);
        result.setDescription("edited channel id:" + id + " shippingDays: " + shippingDays);
        return result;
    } catch (Exception e) {
        logger.error("update is failed!", e);
        // return result
        result.setName(Result.FAILED);
        result.setDescription(e.getMessage());
        return result;
    } finally {
        // release lock
        updateLock = false;
    }
}

[Buggy Hunk]
logger.debug("changed shippingDays " + channel.getPlattform_id() + " " + channel.getShippingDays());

[Patch]
logger.debug("changed shippingDays " + vChannel.getPlattform_id() + " " + vChannel.getShippingDays());