Flaky Behavior in Concurrent Tests Caused by Static Fields
- 1167 words
- 6 minutes read
- 16 Aug 2023
What’s wrong with this Java code?
public class App {
private static Repo repo;
App(Repo repo) {
this.repo = repo;
}
String greet(int id) {
return repo.getGreeting(id);
}
}
class Repo {
String getGreeting(int id) {
throw new UnsupportedOperationException("not implemented yet");
}
}