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

Sonar: Local-Variable Type Inference should be used #12021

Merged
merged 1 commit into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CassandraJSR310DateConvertersTest {
@Test
@DisplayName("Should convert ZonedDateTime to Tuple<Instant, ZoneId>")
void shouldConvertZonedDateTimeToTuple() {
ZonedDateTime source = ZonedDateTime.parse("2023-01-06T12:00:00+01:00[Europe/Paris]");
var source = ZonedDateTime.parse("2023-01-06T12:00:00+01:00[Europe/Paris]");
Instant expectedInstant = source.toInstant();
ZoneId expectedZoneId = source.getZone();
TupleValue result = ZonedDateTimeToTupleConverter.INSTANCE.convert(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class JSR310DateConvertersTest {
@Test
@DisplayName("Should convert ZonedDateTime to Date")
void shouldConvertZonedDateTimeToDate() {
ZonedDateTime source = ZonedDateTime.parse("2022-02-15T12:00:00+01:00[Europe/Paris]");
Date expected = Date.from(source.toInstant());
var source = ZonedDateTime.parse("2022-02-15T12:00:00+01:00[Europe/Paris]");
var expected = Date.from(source.toInstant());
Date result = ZonedDateTimeToDateConverter.INSTANCE.convert(source);
assertThat(result).isEqualTo(expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class JSR310DateConvertersTest {

@Test
void shouldConvertZoneDateTimeToDate() {
ZonedDateTime source = ZonedDateTime.parse("2022-02-15T12:00:00+01:00[Europe/Paris]");
Date expected = Date.from(source.toInstant());
var source = ZonedDateTime.parse("2022-02-15T12:00:00+01:00[Europe/Paris]");
var expected = Date.from(source.toInstant());
Date result = ZonedDateTimeToDateConverter.INSTANCE.convert(source);
assertThat(result).isEqualTo(expected);
}
Expand Down