* @return the {@link Person} created
*/
private Person createPerson(String author) {
String authorName = author.substring(0, author.indexOf("<") - 1).trim();
String authorEmail = author.substring(author.indexOf("<") + 1, author.indexOf(">"));
Person person;
if (author.startsWith("<")) {
authorEmail = author.substring(author.indexOf("<") + 1, author.indexOf(">"));
person = fPersons.get(authorEmail);
} else {
authorName = author.substring(0, author.indexOf("<") - 1).trim();
authorEmail = author.substring(author.indexOf("<") + 1, author.indexOf(">"));
person = fPersons.get(authorName);
}
if (person == null) {
person = new Person();
if (isEmail(authorEmail)) {
person.setEmail(authorEmail);
}
if (authorName != null) {
person.setFirstName(authorName);
}
CommitterRole role = new CommitterRole();
person.addRole(role);
fSession.saveObject(role);
if (authorName != null) {
fPersons.put(authorName, person);
} else {
fPersons.put(authorEmail, person);