[Demonstration 1]

[Buggy Method]
@Transactional
public Result retreiveBuildDetailsFromBambooAndStoreThem(Result result) {
    Participation participation = result.getParticipation();
    Map buildDetails = continuousIntegrationService.get().getLatestBuildResultDetails(participation);
    HashSet<Feedback> feedbacks = continuousIntegrationService.get().createFeedbacksForResult(buildDetails);
    result.setFeedbacks(feedbacks);
    resultRepository.save(result);
    return result;
}

[Buggy Hunk]
resultRepository.save(result);

[Patch]
result = resultRepository.save(result);

[Demonstration 2]

[Buggy Method]
public static CustomEntityDropType fromEntity(Entity entity) {
    CustomEntityDropType entityType = INVALID;
    if (entity instanceof Creeper && ((Creeper) entity).isPowered()) {
        entityType = CustomEntityDropType.POWERED_CREEPER;
    } else if (entity instanceof Rabbit && Type.THE_KILLER_BUNNY.equals(((Rabbit) entity).getRabbitType())) {
        entityType = CustomEntityDropType.KILLER_RABBIT;
    } else if (entity instanceof Player) {
        entityType = CustomEntityDropType.PLAYER;
    } else if (entity instanceof Wolf && ((Wolf) entity).isAngry()) {
        entityType = CustomEntityDropType.ANGRY_WOLF;
    } else if (entity instanceof Skeleton && ((Skeleton) entity).getSkeletonType() == SkeletonType.WITHER) {
        entityType = CustomEntityDropType.WITHER_SKELETON;
    } else if (entity instanceof Zombie && ((Zombie) entity).isVillager()) {
        entityType = CustomEntityDropType.ZOMBIE_VILLAGER;
    } else if (entity instanceof Zombie && ((Zombie) entity).isBaby()) {
        entityType = CustomEntityDropType.ZOMBIE_BABY;
    } else if (entity instanceof LivingEntity) {
        entityType = CustomEntityDropType.fromName(entity.getType().getName());
    }
    //LoggerUtil.getInstance().debugTrue("No match for type: " + entity.getType().getName(), entityType.equals(INVALID));
    return entityType;
}

[Buggy Hunk]
else if (entity instanceof Rabbit && Type.THE_KILLER_BUNNY.equals(((Rabbit) entity).getRabbitType())) {

[Patch]
else if (entity instanceof Rabbit && Rabbit.Type.THE_KILLER_BUNNY.equals(((Rabbit) entity).getRabbitType())) {

[Demonstration 3]

[Buggy Method]
public void notifyChanged(Notification notification) {
    super.notifyChanged(notification);
    if (notification.getFeature() instanceof EAttributeImpl) {
        if (notification.getNotifier() instanceof BoundsImpl) {
            reposition(((BoundsImpl) notification.getNotifier()).getX(), ((BoundsImpl) notification.getNotifier()).getY(), ((BoundsImpl) notification.getNotifier()).getWidth(), getTreeHeight());
            FigureCanvas canvas = (FigureCanvas) getViewer().getControl();
            canvas.getViewport().repaint();
        }
    }
}

[Buggy Hunk]
getTreeHeight());

[Patch]
TreeNodeUtils.getTreeHeight(inputRootTreeNode, LEAF_HEIGHT));