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
I found that VarWizard created a new code which is not semantic-equivalent to the original code for Nullable annotation in Java. For reproducing the bug, please use the following example
"""
import javax.annotation.Nullable;
public class NullableSample {
public static void main(String[] args) {
String nullableString = getNullableString(null);
if (nullableString != null) {
System.out.println(nullableString.toUpperCase());
} else {
System.out.println("Nullable string is null.");
}
}
private static String getNullableString(@Nullable String nullableString) {
boolean condition = true; // Simulating some condition
if (condition) {
return "Hello, World!";
} else {
return null;
}
}
}
"""
In the new code provided by VarWizard, Nullable annotation is replaced by NotNull annotations. This replacement not only changes the semantics of the code but also creates a critical bug in the new code.
I think the bug may come from your parser which wrongly identified @nullable as a variable name.
The text was updated successfully, but these errors were encountered:
Hi,
I found that VarWizard created a new code which is not semantic-equivalent to the original code for Nullable annotation in Java. For reproducing the bug, please use the following example
In the new code provided by VarWizard, Nullable annotation is replaced by NotNull annotations. This replacement not only changes the semantics of the code but also creates a critical bug in the new code.
I think the bug may come from your parser which wrongly identified @nullable as a variable name.
The text was updated successfully, but these errors were encountered: