please help, cant figure out whats wrong
package com.codegym.task.task17.task1710;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/*
CRUD
*/
public class Solution {
public static List<Person> allPeople = new ArrayList<>();
static {
allPeople.add(Person.createMale("Donald Chump", new Date())); // id=0
allPeople.add(Person.createMale("Larry Gates", new Date())); // id=1
}
public static void main(String[] args) throws ParseException {
// Start here
List<String> arguments = new ArrayList<>();
arguments.addAll(Arrays.asList(args));
char option = arguments.get(0).charAt(1);
arguments.remove(0);
if(option == 'c') {
createList(arguments);
}
else if (option == 'u') {
updateList(arguments);
}
else if (option == 'd') {
deleteList(arguments);
}
else if (option == 'i') {
showValue(arguments);
}
}
public static void createList(List<String> args) {
if (args.get(1).equals("m")) {
Person person = Person.createMale(args.get(0), new Date(args.get(2)));
allPeople.add(person);
System.out.println(allPeople.size() - 1);
}
else {
Person person = Person.createFemale(args.get(0), new Date(args.get(2)));
allPeople.add(person);
System.out.println(allPeople.size() - 1);
}
}
public static void updateList(List<String> args) {
int id = Integer.parseInt(args.get(0));
allPeople.get(id).setName(args.get(1));
allPeople.get(id).setBirthDate(new Date(args.get(3)));
if (args.get(2).equals("m")) {
allPeople.get(id).setSex(Sex.MALE);
}
else {
allPeople.get(id).setSex(Sex.FEMALE);
}
}
public static void deleteList(List<String> args) {
int id = Integer.parseInt(args.get(0));
allPeople.get(id).setSex(null);
allPeople.get(id).setName(null);
allPeople.get(id).setBirthDate(null);
allPeople.remove(id);
}
public static void showValue(List<String> args) throws ParseException {
int id = Integer.parseInt(args.get(0));
String name = allPeople.get(id).getName();
String sex = "";
if (allPeople.get(id).getSex().equals(Sex.MALE)) {
sex = "m";
}
else {
sex = "f";
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm dd yyyy");
Date dob = simpleDateFormat.parse(allPeople.get(id).getBirthDate().toString());
System.out.println((name + " " + sex + " " + dob));
}
}