loonwerks/AGREE

NPE in AGREE validator checkNamedElement(NamedElement)

Closed this issue · 2 comments

In the AgreeValidator.checkNamedElement(NamedElement) at the line

if (namedEl.getName().equals(feat.getName())) {

the call to getName() on namedEl may result in a null value generating an NPE on the .equals(...)

The root of the problem is that NamedSpecStatements such as AssumeStatement, GuaranteeStatement, AssertStatement, LemmaStatement, and ReachableStatement are optionally named.

The fix for this issue, however, is quick. Since it is allowed for multiple such statements to be unnamed (that is, a null name), simply check that the name is not null before comparing to other names.

Resolved by #85