Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Improve SDK init performance by replacing `java.net.URI` with custom string parsing for DSN ([#5448](https://github.com/getsentry/sentry-java/pull/5448))
- Remove unnecessary boxing to improve performance ([#5520](https://github.com/getsentry/sentry-java/pull/5520))
- Reduce unboxing in `DateUtils.nanosToDate` ([#5523](https://github.com/getsentry/sentry-java/pull/5523))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: Could just add the PR reference here to the line above, as this is a quick fix. Up to you of course.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we just made a release so I'll need to rebase this PR.


### Fixes

Expand Down
4 changes: 2 additions & 2 deletions sentry/src/main/java/io/sentry/DateUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public static double nanosToMillis(final double nanos) {
* @return date rounded down to milliseconds
*/
public static Date nanosToDate(final long nanos) {
final Double millis = nanosToMillis((double) nanos);
return getDateTime(millis.longValue());
final double millis = nanosToMillis((double) nanos);
return getDateTime((long) millis);
}

public static @Nullable Date toUtilDate(final @Nullable SentryDate sentryDate) {
Expand Down
Loading