kotlinx-lincheck
kotlinx-lincheck copied to clipboard
Try to improve caller (a.k.a. owner) names via tracking local variables
When calling Object#1.foo(), we would like to make the call more intuitive:
- in case
thisequalsObject#1, we drop the caller name and show onlyfoo() - in case there is a local variable referencing
Object#1, we would like to show the local variable name, thus, showingvariableName.foo() - in case there exists a field of
thisthat referencesObject#1, we would like to replaceObject#1with the field name, thus, showingfieldName.foo() - otherwise, we show
Object#1.foo()
One important note is that objects referenced by only static final fields are presented as the corresponding field names.
E.g., when manipulating the BROKEN object below, it should shown in the trace as BROKEN, not smth like Object#25.
class Foo {
private static final BROKEN = new Object();
}
Let's analyze how good the suggested semantics is and try to achieve the best.
Related task: Track local variables #507
Consider printing varName[ObjectClass#<id>] for shared objects, making it easier to track shared objects
@eupp, should we close this issue, or is there something that should be fixed before that?
There are a lot of various problems and design questions around this feature, let's discuss on a meeting. We will probably need to split it into sub-tasks.