Results 20 comments of agrieve

Checked the same example using `a == b`, and no warning in that case.

No problem: This works: ```java import org.jspecify.annotations.Nullable; import org.jspecify.annotations.NullMarked; import org.chromium.build.annotations.Contract; @NullMarked public class Foo { static boolean isSame(@Nullable Object a, @Nullable Object b) { return a == b; }...

Another simple example (which I'm not sure is the same or not): ``` @NullMarked class Foo { static void main() { FutureTask task = new FutureTask(() -> {}, null); }...

Oh, happens without library model as well: ``` import org.chromium.build.annotations.Nullable; import org.chromium.build.annotations.NullMarked; @NullMarked class Foo { static class Example { Example(T thing) {} } static void main() { Example example...

This has the same warning if I fill in the generics: ``` static void main() { Example example = new Example(null); } ```

Note: adding a thread hop to fix the above exception just leads to another one: ``` C 13:11:43.055 48.889s Main at org.chromium.base.ThreadUtils$ThreadChecker.assertOnValidThreadHelper(ThreadUtils.java:97) C 13:11:43.055 48.889s Main at org.chromium.base.ThreadUtils$ThreadChecker.assertOnValidThread(ThreadUtils.java:71) C 13:11:43.055...

This patch fixes things locally in Chrome: ``` 19a20 > import android.os.Looper; 31a33,34 > import java.util.concurrent.atomic.AtomicReference; > import java.util.function.Supplier; 72c75 < Throwable error = truncater.truncateExceptionMessage(exception, msgLen, viewHierarchyFile); --- > Throwable...

Hit this as well. The specific case I ran into was in this form: ``` @NullMarked public class Foo { public static class Key {} private static final Key KEY...

Heh, this is coming up more with the new release because now our annotations within generics are being noticed more :P. Here's a simpler example: ``` import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable;...

I think that would actually address the majority of our warnings of this type :)