Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve trace representation: show non-this object instances on method calls and show field names when using VarHandle, AtomicReference, andUnsafe #325

Conversation

avpotapov00
Copy link
Collaborator

Closes #315 , #317 , #320 and #324

…micReference methods trace points made more readable.
@avpotapov00 avpotapov00 requested a review from ndkoval May 8, 2024 11:51
@avpotapov00 avpotapov00 self-assigned this May 8, 2024
Copy link
Collaborator

@ndkoval ndkoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a significant UX improvement! I've passed over most of the changes. Please address the comments.

LincheckJavaAgent.ensureObjectIsTransformed(testInstance)
ensuredTestInstanceIsTransformed = true
if (strategy is ModelCheckingStrategy) {
strategy.initializeCallStack(testInstance)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, the comment above is incorrect.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides, it's unclear what this call does and why you need it in the runner.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this logic added to Runner instead of ManagedStrategy.initializeInvocation?

@avpotapov00 avpotapov00 requested a review from ndkoval May 8, 2024 15:55
LincheckJavaAgent.ensureObjectIsTransformed(testInstance)
ensuredTestInstanceIsTransformed = true
if (strategy is ModelCheckingStrategy) {
strategy.initializeCallStack(testInstance)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this logic added to Runner instead of ManagedStrategy.initializeInvocation?


private fun simpleClassName(className: String) = className.takeLastWhile { it != '/' }

private fun initializeUnsafeMethodCallTracePoint(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize or create?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initialize because it's created previously in the common logic part.

@avpotapov00 avpotapov00 requested a review from ndkoval May 8, 2024 18:50
Copy link
Collaborator

@ndkoval ndkoval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the PR, but we need to address the remaining comments. @avpotapov00

@ndkoval ndkoval changed the title Show object identifiers when calling methods or manipulating fields on non this instances. Improve trace representation: show non-this object instances on method calls and show field names when using VarHandle, AtomicReference, andUnsafe May 8, 2024
@ndkoval ndkoval merged commit f274c6d into develop May 8, 2024
15 checks passed
@ndkoval ndkoval deleted the 320-show-object-identifiers-when-calling-methods-or-manipulating-fields-on-non-this-instances branch May 8, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants