Skip to content

Commit

Permalink
LogEntry: Convert to legacy Exception - fixes eclipse-platform#829
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and jukzi committed Jun 16, 2023
1 parent 59de4df commit 8ae1225
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.*;
import org.eclipse.core.runtime.IStatus;

Expand Down Expand Up @@ -245,10 +246,17 @@ public void processEntry(String line) throws ParseException {
}
}
}
Date date = Date.from(Instant.from(GREGORIAN_SDF.parse(dateBuffer.toString())));
if (date != null) {
fDate = date;
fDateString = LOCAL_SDF.format(fDate.toInstant());
String stringToParse = dateBuffer.toString();
try {
Date date = Date.from(Instant.from(GREGORIAN_SDF.parse(stringToParse)));
if (date != null) {
fDate = date;
fDateString = LOCAL_SDF.format(fDate.toInstant());
}
} catch (DateTimeParseException e) {
ParseException parseException = new ParseException(e.getMessage(), e.getErrorIndex());
parseException.addSuppressed(e);
throw parseException;
}
}

Expand Down

0 comments on commit 8ae1225

Please sign in to comment.