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
Commit d70dd74 introduces a false negative, in its use of CFAbstractStore.insertValuePermitNondeterministic(). Consider this test case:
importjava.util.Optional;
classPureGetterTest2 {
Optional<String> otherOptional() {
if (Math.random() < 0.5) {
returnOptional.ofNullable(null);
} else {
returnOptional.of("hello world");
}
}
voidfoo() {
if (otherOptional().isPresent()) {
// BUG: no "method.invocation" error is issued here.otherOptional().get();
}
}
}
In a postcondition like @EnsuresPresent("field.method()"), it is correct to permit method() in the expression even if it is not @Deterministic. However, in a postcondition like @EnsuresPresent("#1.method()"), it should not be permitted to substitute in an argument that is not @Deterministic.
The text was updated successfully, but these errors were encountered:
Commit d70dd74 introduces a false negative, in its use of
CFAbstractStore.insertValuePermitNondeterministic()
. Consider this test case:In a postcondition like
@EnsuresPresent("field.method()")
, it is correct to permitmethod()
in the expression even if it is not@Deterministic
. However, in a postcondition like@EnsuresPresent("#1.method()")
, it should not be permitted to substitute in an argument that is not@Deterministic
.The text was updated successfully, but these errors were encountered: