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

org.robolectric.util.Scheduler should use java.time APIs #8976

Open
kluever opened this issue Apr 8, 2024 · 2 comments
Open

org.robolectric.util.Scheduler should use java.time APIs #8976

kluever opened this issue Apr 8, 2024 · 2 comments

Comments

@kluever
Copy link
Contributor

kluever commented Apr 8, 2024

Instead of using an ambiguous (w.r.t. the unit) long to represent date/time concepts (like a delay or "now"), please use the appropriate java.time types (Duration or Instant).

There's a bunch of APIs in org.robolectric.util.Scheduler that could be improved using java.time types.

@brettchabot
Copy link
Contributor

IMO Scheduler API should have been deprecated at the same time as LooperMode.LEGACY. I'll send out a PR to correct this.

copybara-service bot pushed a commit that referenced this issue Apr 8, 2024
Scheduler API is obsolete and ShadowLooper APIs should be used instead.

Related to #8976

PiperOrigin-RevId: 622908813
copybara-service bot pushed a commit that referenced this issue Apr 8, 2024
Scheduler API is obsolete and ShadowLooper APIs should be used instead.

Related to #8976

PiperOrigin-RevId: 622943971
@hoisie
Copy link
Contributor

hoisie commented Apr 11, 2024

@kluever thanks for the post. These APIs are probably suboptimal. However, they are related to the legacy looper mode, which has been deprecated for 5+ years. There is not much point in investing a significant amount of resources to migrate something that is deprecated and obsolete to a more modern API.

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

3 participants