Skip to content

Commit

Permalink
javafmtAll
Browse files Browse the repository at this point in the history
  • Loading branch information
radeusgd committed Sep 20, 2023
1 parent b588b73 commit 39db2eb
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import org.enso.interpreter.dsl.Builtin;
import org.enso.interpreter.runtime.EnsoContext;
import org.enso.interpreter.runtime.library.dispatch.TypesLibrary;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import org.enso.interpreter.dsl.Builtin;
import org.enso.interpreter.runtime.EnsoContext;
import org.enso.interpreter.runtime.data.text.Text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.chrono.IsoChronology;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.DateTimeParseException;
import java.time.format.ResolverStyle;
import java.time.temporal.ChronoField;
import java.time.temporal.TemporalQueries;

public class Core_Date_Utils {
/** default Date Time formatter for parsing a Date_Time. */
public static final DateTimeFormatter defaultZonedDateTimeFormatter =
new DateTimeFormatterBuilder()
.parseLenient()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral(' ')
.append(DateTimeFormatter.ISO_LOCAL_TIME)
.optionalStart()
.parseLenient()
.appendOffsetId()
.optionalEnd()
.optionalStart()
.appendLiteral('[')
.parseCaseSensitive()
.appendZoneRegionId()
.appendLiteral(']')
.toFormatter();
new DateTimeFormatterBuilder()
.parseLenient()
.append(DateTimeFormatter.ISO_LOCAL_DATE)
.appendLiteral(' ')
.append(DateTimeFormatter.ISO_LOCAL_TIME)
.optionalStart()
.parseLenient()
.appendOffsetId()
.optionalEnd()
.optionalStart()
.appendLiteral('[')
.parseCaseSensitive()
.appendZoneRegionId()
.appendLiteral(']')
.toFormatter();

/** default Date formatter for parsing a Date. */
public static final DateTimeFormatter defaultLocalDateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;
public static final DateTimeFormatter defaultLocalDateFormatter =
DateTimeFormatter.ISO_LOCAL_DATE;

/** default Time formatter for parsing a Time_Of_Day. */
public static final DateTimeFormatter defaultLocalTimeFormatter = DateTimeFormatter.ISO_LOCAL_TIME;
public static final DateTimeFormatter defaultLocalTimeFormatter =
DateTimeFormatter.ISO_LOCAL_TIME;

/**
* Parse a date string into a LocalDate. Allows missing day (assumes first day of month) or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.enso.table.parsing;

import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import org.enso.base.Time_Utils;
import org.enso.base.time.EnsoDateTimeFormatter;
import org.enso.table.parsing.problems.ProblemAggregator;

Expand All @@ -25,7 +23,8 @@ protected Object parseSingleValue(String text, ProblemAggregator problemAggregat
try {
return parseStrategy.parse(text, formatter);
} catch (DateTimeParseException ignored) {
// TODO I think ideally we should try to return Option instead of throwing, as throwing is inefficient
// TODO I think ideally we should try to return Option instead of throwing, as throwing is
// inefficient
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

public class DateParser extends BaseTimeParser {
public DateParser(EnsoDateTimeFormatter[] formatters) {
super(formatters, (String text, EnsoDateTimeFormatter formatter) -> formatter.parseLocalDate(text));
super(
formatters,
(String text, EnsoDateTimeFormatter formatter) -> formatter.parseLocalDate(text));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

public class DateTimeParser extends BaseTimeParser {
public DateTimeParser(EnsoDateTimeFormatter[] formatters) {
super(formatters, (String text, EnsoDateTimeFormatter formatter) -> formatter.parseZonedDateTime(text));
super(
formatters,
(String text, EnsoDateTimeFormatter formatter) -> formatter.parseZonedDateTime(text));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

public class TimeOfDayParser extends BaseTimeParser {
public TimeOfDayParser(EnsoDateTimeFormatter[] formatters) {
super(formatters, (String text, EnsoDateTimeFormatter formatter) -> formatter.parseLocalTime(text));
super(
formatters,
(String text, EnsoDateTimeFormatter formatter) -> formatter.parseLocalTime(text));
}

@Override
Expand Down

0 comments on commit 39db2eb

Please sign in to comment.