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";
  }
}

@@ -320,79 +320,8 @@
 ew;%0A
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;%0A
 impo
@@ -1001,36 +1001,55 @@
 %7B%0A    throw new 
+RuntimeException(%22
 Not
-I
+ i
 mplementedExcept
@@ -1038,34 +1038,26 @@
  implemented
-Exception(
+.%22
 );%0A  %7D%0A%0A  @R
@@ -1222,12 +1222,31 @@
 new 
+RuntimeException(%22
 Not
-I
+ i
 mple
@@ -1251,26 +1251,18 @@
 lemented
-Exception(
+.%22
 );%0A  %7D%0A%0A

Change NotImplementedException to RuntimeException