The validation still give me this massage
Be sure that the read() method correctly reads the first name, middle name, and last name from the file and stores them in a Person object.
package com.codegym.task.task19.task1904;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
/*
Yet another adapter
*/
public class Solution {
public static void main(String[] args) {
}
public static class PersonScannerAdapter implements PersonScanner{
private Scanner fileScanner;
PersonScannerAdapter(Scanner fileScanner){
this.fileScanner = fileScanner;
}
@Override
public Person read() throws IOException{
Date date = null;
String s = fileScanner.nextLine();
String[] data = s.split(" ");
String first = data[0];
String middle = data[1];
String last = data[2];
String month = data[3];
String days = data[4];
String year = data[5];
String dfo = month + days + year;
SimpleDateFormat dateFormat = new SimpleDateFormat("MM dd yyyy");
try {
date = dateFormat.parse(dfo);
}catch (ParseException e){}
return new Person(middle,last,first,date);
}
@Override
public void close() throws IOException {
fileScanner.close();
}
}
}