Introduce Nullable annotation.

Just adds the annotation to base_java for now to check that this does
not break any downstream targets.

Bug: webrtc:8881
Change-Id: I9425020e36be5e52447cec592a4474a9eb09b5bd
Reviewed-on: https://webrtc-review.googlesource.com/51960
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22526}
This commit is contained in:
Sami Kalliomäki
2018-03-20 16:32:49 +01:00
committed by Commit Bot
parent 7531a761d3
commit e7fac68c97
4 changed files with 23 additions and 3 deletions

View File

@ -16,13 +16,14 @@ import android.os.SystemClock;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
public class ThreadUtils {
/**
* Utility class to be used for checking that a method is called on the correct thread.
*/
public static class ThreadChecker {
private Thread thread = Thread.currentThread();
@Nullable private Thread thread = Thread.currentThread();
public void checkIsOnValidThread() {
if (thread == null) {