-
Notifications
You must be signed in to change notification settings - Fork 19
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
Strange behavior in Nullness Checker #1069
Comments
Thanks for your report! I see the problem because the annotations are not correct in the annotated JDK. For When you use a local variable, it is started as I think we should annotate @wmdietl how do you think? |
The JDK describes that in So I would say |
Both the The question is about the right annotation for the array component type. This is required, as the size of the copy could be larger than the original array. As the javadoc states The example in the first post is actually an example of this: in So, the error without a local variable seems correct to me, as there is a mismatch in the array component type.
This passes the Nullness Checker, but when running results in an NPE. The JDK for the two Line 759 in 1799158
However, that logic correctly does not refine the type in the call in these examples here. @Ao-senXiong Can you create a PR that adds those comments? |
@wmdietl Thanks, see eisop/jdk#109. |
Following code only works if I use a intermediate variable to store the result.
Here is non-working code:
Here is the working code (
var a = ...
):The error message is:
The snippet comes form the KeY-project
Eiop used via Gradle plugin:
The text was updated successfully, but these errors were encountered: