codespecs / daikon

Dynamic detection of likely invariants
http://plse.cs.washington.edu/daikon/
Other
214 stars 54 forks source link

Chicory regression regarding unmodifiable derived variables #515

Closed mernst closed 9 months ago

mernst commented 1 year ago

Consider file tests/daikon-tests/ArrayList17/ArrayList17.txt-chicory.goal.

For variable javautil.ArrayList17.EMPTY_ELEMENTDATA.getClass().getName() the "flags" field contains "nomod".

However, in generated file tests/daikon-tests/ArrayList17/ArrayList17.txt-chicory.dtrace the "flags" field does not "nomod".

The source code is

    private static final Object[] EMPTY_ELEMENTDATA = {}

and while the object can be modified (by adding elements to the array), the object itself never changes, nor does its class.

This raises two issues:

  1. Chicory should output "nomod" for unmodifiable variables, of which the class of a final variable is an example. (Chicory does continue to output "nomod" in some other circumstances.)

  2. DtraceDiff has a TODO comment what about comparability and aux info?, DtraceDiff should be updated to check that information.

markro49 commented 9 months ago

Pull request #528 "Add compare decls to DtraceDiff" corrects this issue.