Switch from boxed Boolean to primitive boolean

Also add a parameter comment and reformat with `google-java-format`.
This commit is contained in:
Ian Baker 2023-05-31 18:04:16 +01:00
parent c331ac64e7
commit 1b564c67f2

View File

@ -99,7 +99,12 @@ public final class ListenerSet<T extends @NonNull Object> {
* during one {@link Looper} message queue iteration were handled by the listeners.
*/
public ListenerSet(Looper looper, Clock clock, IterationFinishedEvent<T> iterationFinishedEvent) {
this(/* listeners= */ new CopyOnWriteArraySet<>(), looper, clock, iterationFinishedEvent, true);
this(
/* listeners= */ new CopyOnWriteArraySet<>(),
looper,
clock,
iterationFinishedEvent,
/* throwsWhenUsingWrongThread= */ true);
}
private ListenerSet(
@ -107,7 +112,7 @@ public final class ListenerSet<T extends @NonNull Object> {
Looper looper,
Clock clock,
IterationFinishedEvent<T> iterationFinishedEvent,
Boolean throwsWhenUsingWrongThread) {
boolean throwsWhenUsingWrongThread) {
this.clock = clock;
this.listeners = listeners;
this.iterationFinishedEvent = iterationFinishedEvent;
@ -150,7 +155,8 @@ public final class ListenerSet<T extends @NonNull Object> {
@CheckResult
public ListenerSet<T> copy(
Looper looper, Clock clock, IterationFinishedEvent<T> iterationFinishedEvent) {
return new ListenerSet<>(listeners, looper, clock, iterationFinishedEvent, throwsWhenUsingWrongThread);
return new ListenerSet<>(
listeners, looper, clock, iterationFinishedEvent, throwsWhenUsingWrongThread);
}
/**