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

Mutative methods that are package-private don't trigger storage of a snapshot. #43

Open
sageserpent-open opened this issue Jun 30, 2018 · 2 comments
Labels

Comments

@sageserpent-open
Copy link
Owner

This was seen and worked-around in issue #39 . The problem is that if a mutating method calls another mutating method on one of its item arguments, the latter won't be detected as a mutation if the argument's method is package-private.

Given this is a natural way of enforcing relationship invariants on item that can refer to each other cyclically, we should support this.

@sageserpent-open
Copy link
Owner Author

The quick way to fix this is to intercept package private mutators.

@sageserpent-open
Copy link
Owner Author

Actually, this is supported already by ByteBuddy - the problem is that an override can't be defined by ByteBuddy unless the proxy class exists in the same package as the method being overridden / defined. Need to think about this - what if a class inherits several interfaces that define package-private methods, but the interfaces are in separate packages?

Even then, I'm unsure as to whether ByteBuddy will forward a call to another object from the package-private override it creates. It seems logical that it can do this, but...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant