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

Stacktrace prints on Android JVM unit tests #530

Open
erikhuizinga opened this issue Apr 24, 2020 · 1 comment
Open

Stacktrace prints on Android JVM unit tests #530

erikhuizinga opened this issue Apr 24, 2020 · 1 comment

Comments

@erikhuizinga
Copy link

erikhuizinga commented Apr 24, 2020

Here

a stack trace is printed, after which a default new UTCProvider() is returned. This can lead to stack traces being printed to STDERR while no exception is actually thrown by Joda Time. For example, on Android, when running JVM unit tests, this can happen, e.g. see dlew/joda-time-android#148. (Joda Time Android uses Joda Time).

The solution for that issue is to set the default new UTCProvider() before using Joda Time in tests. This is not user friendly. It would be better if there was a way to get a provider without a stacktrace being printed, or to check if a provider is available before getting it (which is a bit silly, probably).

The proposed solution is to default to not printing the stack trace on the line linked above, or make the stack trace printing opt in through some kind of configuration. Alternatively, there could be a method to check if there is a provider, so that the user can provide their own if there is none.

@jodastephen
Copy link
Member

It would be possible to change the notzdb version of Joda-Time to contain the UTC provider. It would be a fair bit of work solely for an edge case of Android users, so its not something I'm rushing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants