Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to linter java.time.LocalDateTime values #1

Closed
angryziber opened this issue Jan 28, 2022 · 0 comments
Closed

Fails to linter java.time.LocalDateTime values #1

angryziber opened this issue Jan 28, 2022 · 0 comments

Comments

@angryziber
Copy link

angryziber commented Jan 28, 2022

expect(LocalDateTime.MIN).to.beSameInstance(LocalDateTime.MIN)

Fails with:

Unsupported field: OffsetSeconds
java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: OffsetSeconds
	at java.base/java.time.LocalDate.get0(LocalDate.java:709)
	at java.base/java.time.LocalDate.getLong(LocalDate.java:688)
	at java.base/java.time.LocalDateTime.getLong(LocalDateTime.java:718)
	at java.base/java.time.format.DateTimePrintContext$1.getLong(DateTimePrintContext.java:205)
	at java.base/java.time.format.DateTimePrintContext.getValue(DateTimePrintContext.java:308)
	at java.base/java.time.format.DateTimeFormatterBuilder$OffsetIdPrinterParser.format(DateTimeFormatterBuilder.java:3628)
	at java.base/java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(DateTimeFormatterBuilder.java:2402)
	at java.base/java.time.format.DateTimeFormatter.formatTo(DateTimeFormatter.java:1849)
	at java.base/java.time.format.DateTimeFormatter.format(DateTimeFormatter.java:1823)
	at net.oddpoet.expect.Literalizer$Registry$16.invoke(Literalizer.kt:50)
	at net.oddpoet.expect.Literalizer$Registry$16.invoke(Literalizer.kt:20)
	at net.oddpoet.expect.Literalizer$Registry$register$1.literal(Literalizer.kt:67)
	at net.oddpoet.expect.Literalizer$Registry$TypedLiteralizer.literal(Literalizer.kt:97)
	at net.oddpoet.expect.Literalizer$Registry.literal(Literalizer.kt:56)
	at net.oddpoet.expect.Expect.getLiteral(Expect.kt:92)
...

All in all, timeFormatter is not needed - all java.time classes have good toString() implementations.

@angryziber angryziber changed the title Fails to linter java.time MIN constants Fails to linter java.time.LocalDateTime, LocalTime, Instant values Jan 28, 2022
@angryziber angryziber changed the title Fails to linter java.time.LocalDateTime, LocalTime, Instant values Fails to linter java.time.LocalDateTime values Jan 28, 2022
odd-poet added a commit that referenced this issue Feb 1, 2022
1.3.1

close #1, #2
migrate publishing to mavencentral
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant