<commit_before>package tk.puncha.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import tk.puncha.dao.OwnerDAO;
import tk.puncha.dao.PetDAO;
import tk.puncha.models.Owner;

import java.util.List;

@Controller
@RequestMapping("/owners")
public class OwnerController {

  @Autowired
  private OwnerDAO ownerDAO;

  @Autowired
  private PetDAO petDAO;

  @RequestMapping(path = {"", "index"}, method = RequestMethod.GET)
  public ModelAndView index() {
    List<Owner> owners = ownerDAO.getAllOwners();
    ModelAndView modelView = new ModelAndView();
    modelView.addObject("owners", owners);
    modelView.setViewName("owner/index");
    return modelView;
  }

  @RequestMapping(path = "new", method = RequestMethod.GET)
  public ModelAndView newOwnerForm() {
    throw new NotImplementedException();
  }

  @RequestMapping(path = "new", method = RequestMethod.POST)
  public ModelAndView createNewOwner() {
    // dispatch to ownerDAO to create a new owner
    throw new NotImplementedException();
  }

  @RequestMapping(path = "delete", method = RequestMethod.POST)
  public String deleteOwner(Owner owner) {
    int ownerId = owner.getId();
    petDAO.deletePetsByOwnerId(ownerId);
    ownerDAO.deleteOwner(ownerId);
    return "redirect:/owners";
  }
}<commit_msg>Change NotImplementedException to RuntimeException<commit_after>package tk.puncha.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import tk.puncha.dao.OwnerDAO;
import tk.puncha.dao.PetDAO;
import tk.puncha.models.Owner;

import java.util.List;

@Controller
@RequestMapping("/owners")
public class OwnerController {

  @Autowired
  private OwnerDAO ownerDAO;

  @Autowired
  private PetDAO petDAO;

  @RequestMapping(path = {"", "index"}, method = RequestMethod.GET)
  public ModelAndView index() {
    List<Owner> owners = ownerDAO.getAllOwners();
    ModelAndView modelView = new ModelAndView();
    modelView.addObject("owners", owners);
    modelView.setViewName("owner/index");
    return modelView;
  }

  @RequestMapping(path = "new", method = RequestMethod.GET)
  public ModelAndView newOwnerForm() {
    throw new RuntimeException("Not implemented.");
  }

  @RequestMapping(path = "new", method = RequestMethod.POST)
  public ModelAndView createNewOwner() {
    // dispatch to ownerDAO to create a new owner
    throw new RuntimeException("Not implemented.");
  }

  @RequestMapping(path = "delete", method = RequestMethod.POST)
  public String deleteOwner(Owner owner) {
    int ownerId = owner.getId();
    petDAO.deletePetsByOwnerId(ownerId);
    ownerDAO.deleteOwner(ownerId);
    return "redirect:/owners";
  }
}
{'fraction_non_alphanumeric': 0.11037735849056604, 'fraction_numerical': 0.0, 'mean_word_length': 5.047528517110266, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6076929', 'n_tokens_mistral': 956, 'n_tokens_neox': 954, 'n_words': 197}