You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Issue160 {
public static void t1() {
String s = null;
if (s != null) {
s = "abc";
} else {
s = "123";
// return;
}
System.out.println(s.toString());
}
}
Code with default annotation from getDefaultAnnotation():
@NonNull
public class Issue160 {
public static void t1() {
@NonNull String s = null;
if (s != null) {
s = "abc";
} else {
s = "123";
// return;
}
System.out.println(s.toString());
}
}
Both the @NonNull annotations are incorrect. Based on the discussion with @zcai1, the method to fetch the default annotation doesn't understand that String s is a local variable.
The text was updated successfully, but these errors were encountered:
Original code:
Code with default annotation from
getDefaultAnnotation()
:Both the
@NonNull
annotations are incorrect. Based on the discussion with @zcai1, the method to fetch the default annotation doesn't understand thatString s
is a local variable.The text was updated successfully, but these errors were encountered: