Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update handling of annotations on varargs argument #1025

Merged
merged 29 commits into from
Sep 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tweak test
  • Loading branch information
msridhar committed Aug 23, 2024
commit d25d350299a0857b47011cc452d602e6d73a80f3
10 changes: 1 addition & 9 deletions nullaway/src/test/java/com/uber/nullaway/VarargsTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,8 @@ public void testNullableVarargs() {
"package com.uber;",
"import javax.annotation.Nullable;",
"public class Utilities {",
// TODO a declaration annotation at the top level should apply to the individual
// arguments, not the variable itself
" public static String takesNullableVarargs(Object o, @Nullable Object... others) {",
" String s = o.toString() + \" \";",
" for (Object other : others) {",
" s += (other == null) ? \"(null) \" : other.toString() + \" \";",
" }",
" for (Object other : others) {",
" s += other.toString();", // SHOULD be an error!
" }",
" String s = o.toString() + \" \" + others.toString();",
" return s;",
" }",
"}")
Expand Down