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
Currently, when a unit test fails, it displays all the reasons a class is mutable. Each reason is printed with a location, the 'primary' source of mutability, for example, [Field: hash, Class: java.lang.String] for the hash field that can be reassigned. A user will have to read this then navigate to the file and field themselves.
Text output in test failure shown here:
We can do more to make it easier to find the source of mutability. At least two of the three major IDEs (Eclipse and Intellij, not checked NetBeans) have functionality that interprets elements of a stack trace, to allow clicking through to source.
Like here:
Eclipse:
IntelliJ:
This is achieved by having a string which matches a particular format, like: at java.lang.String.<init>(String.java:105)
(the "at", with that casing, is significant).
We could take advantage of this trick in the IDEs to allow us to print locations which are clickable.
This issue would represent three bits of work:
making sure that every reason also prints a location which matches this format, such that it can be clicked through
an audit of all existing checkers, to make sure that they provide the most appropriate location for the reason (e.g. for reassigned fields, do we point to the field, or where it's reassigned?)
potentially doing extra bytecode analysis, to find the class, method, and line number of the most suitable location for the reason
The text was updated successfully, but these errors were encountered:
By "fix the linking" do you mean a code change that will print out the format that becomes a link, but not the change to provide accurate numbers? I think that would be a reasonable chunk to contribute. Perhaps there should be a class/interface/datastructure that can be created (if it doesn't already exist) that can be printed out, but maybe just is created with dummy line numbers for now, but can be filed in accurately when #46 is complete.
Currently, when a unit test fails, it displays all the reasons a class is mutable. Each reason is printed with a location, the 'primary' source of mutability, for example, [Field: hash, Class: java.lang.String] for the hash field that can be reassigned. A user will have to read this then navigate to the file and field themselves.
Text output in test failure shown here:
We can do more to make it easier to find the source of mutability. At least two of the three major IDEs (Eclipse and Intellij, not checked NetBeans) have functionality that interprets elements of a stack trace, to allow clicking through to source.
Like here:
Eclipse:
IntelliJ:
This is achieved by having a string which matches a particular format, like:
at java.lang.String.<init>(String.java:105)
(the "at", with that casing, is significant).
We could take advantage of this trick in the IDEs to allow us to print locations which are clickable.
This issue would represent three bits of work:
The text was updated successfully, but these errors were encountered: