в чем может быть ошибка?
package com.javarush.task.task19.task1921;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.io.*;
import java.text.*;
import java.util.regex.*;
/*
Хуан Хуанович
*/
public class Solution {
public static final List<Person> PEOPLE = new ArrayList<Person>();
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
while (reader.ready()) {
String line = reader.readLine();
String[] str = line.split(" ");
if (isDigit(str[1]) == true ) {
String strDate = str[1] + " " + str[2] + " " + str[3];
SimpleDateFormat form = new SimpleDateFormat("dd MM yyyy");
Date bDate = form.parse(strDate);
Person person1 = new Person(str[0], bDate);
PEOPLE.add(person1);
}
else if (isDigit(str[2]) == true && isDigit(str[1]) == false) {
String name = str[0] + " " + str[1];
String strDate = str[2] + " " + str[3] + " " + str[4];
SimpleDateFormat form = new SimpleDateFormat("dd MM yyyy");
Date bDate = form.parse(strDate);
Person person2 = new Person(name, bDate);
PEOPLE.add(person2);
}
else if (isString(str[2]) == true) {
String name = str[0] + " " + str[1] + " " + str[2];
String strDate = str[3] + " " + str[4] + " " + str[5];
SimpleDateFormat form = new SimpleDateFormat("dd MM yyyy");
Date bDate = form.parse(strDate);
Person person3 = new Person(name, bDate);
PEOPLE.add(person3);
}
reader.close();
}
}
public static boolean isDigit(String testString){
Pattern p = Pattern.compile("[0-9]+");
Matcher m = p.matcher(testString);
return m.matches();
}
public static boolean isString(String test) {
Pattern p = Pattern.compile("[a-zA-Zа-яА-Я]+");
Matcher m = p.matcher(test);
return m.matches();
}
}