From edaaf9e3bc33141c92f7866d7a18870a7df2ecc0 Mon Sep 17 00:00:00 2001 From: David Aghalarpour Date: Wed, 30 Oct 2013 15:06:21 -1000 Subject: [PATCH] Performed some code cleanup. --- app/controllers/Application.java | 5 ++--- app/views/formdata/FootstyleTypes.java | 16 ---------------- app/views/formdata/SurferFormData.java | 1 + 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/app/controllers/Application.java b/app/controllers/Application.java index 27d3c18..d2be302 100644 --- a/app/controllers/Application.java +++ b/app/controllers/Application.java @@ -79,7 +79,6 @@ public static Result postSurfer() { else { SurferFormData data = formData.get(); //Creates the object we made (SurferFormData) and fills with get data - //Create Update event. Note, should consider moving this to SurferDB addSurfer method if (!SurferDB.slugExists(data.slug)) { //If slug does not exist yet in DB, it must be a new event UpdateDB.addUpdate("Create", data.name); @@ -88,7 +87,7 @@ public static Result postSurfer() { UpdateDB.addUpdate("Edit", data.name); } - //Add to database + //Add to database SurferDB.addSurfer(data); Map surferTypeMap = SurferTypes.getTypes(data.surferType); @@ -120,7 +119,7 @@ public static Result deleteSurfer(String slug) { } /** - * Returns the show updates page. + * Returns the updates page. * @return The updates page. */ public static Result getUpdates() { diff --git a/app/views/formdata/FootstyleTypes.java b/app/views/formdata/FootstyleTypes.java index 9377cda..465f54d 100644 --- a/app/views/formdata/FootstyleTypes.java +++ b/app/views/formdata/FootstyleTypes.java @@ -26,22 +26,6 @@ public static List getTypes() { return typeList; } - /** - * Returns a list of footstyle types with the passed footstyleType set to true. - * Assumes that footstyleType is a legal footstyle type. - * @param footstyleType The footstyle type. - * @return The footstyle type list. - */ - public static List getTypes(String footstyleType) { - List typeList = FootstyleTypes.getTypes(); - //First checks if footstyleType is a valid type. If it is, then sets that footstyleType to true in the list. - if (isType(footstyleType)) { - typeList.add(footstyleType); - } - - return typeList; - } - /** * Returns true if footstyleType is a valid footstyle type. * @param footstyleType The potential footstyle type. diff --git a/app/views/formdata/SurferFormData.java b/app/views/formdata/SurferFormData.java index a44b73d..8de41e6 100644 --- a/app/views/formdata/SurferFormData.java +++ b/app/views/formdata/SurferFormData.java @@ -96,6 +96,7 @@ public SurferFormData(Surfer surfer) { * The Awards field is optional. It can be empty. * The Slug field must be alphanumeric, and must be unique. * The SurferType field must be either "Male", "Female", or "Grom". + * The footstyleType field must be either "Regular" or "Goofy". * * * @return null if no errors, list of ValidationErrors if errors.