in src/main/java/com/googlesource/gerrit/plugins/quota/RateLimitUploadListener.java [47:61]
static {
try {
Class<?> sleepingStopwatchClass =
Class.forName("com.google.common.util.concurrent.RateLimiter$SleepingStopwatch");
createStopwatchMethod = sleepingStopwatchClass.getDeclaredMethod("createFromSystemTimer");
createStopwatchMethod.setAccessible(true);
Class<?> burstyRateLimiterClass =
Class.forName("com.google.common.util.concurrent.SmoothRateLimiter$SmoothBursty");
constructor = burstyRateLimiterClass.getDeclaredConstructors()[0];
constructor.setAccessible(true);
} catch (ClassNotFoundException | NoSuchMethodException e) {
// shouldn't happen
throw new RuntimeException("Failed to prepare loading RateLimiter via reflection", e);
}
}