-
Notifications
You must be signed in to change notification settings - Fork 13
workaround or fix for the npe during Rascal testing #304
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
Conversation
|
Test Results 99 files 99 suites 5m 51s ⏱️ Results for commit 07ac82e. |
Shouldn't the fix be that the equals method should return false for null? That's the contract of equals. Since this change now keeps references alive more frequent. (The get would normally only he done after an equal hashcode) |
Yes, but the wrapper My question is: do you also think this code is brittle for the case of garbage collected references, and that the fix is therefore correct? |
I meant that |
Can you explain that?
So that should return |
Everytime you do a get, the reference is marked as in use, and that's what we want to avoid.
Exactly, since the equals method should always be safe for a null value as parameter. In 99% the |
Ok thanks; I'm going to fix the equals method instead. This is exactly the feedback I needed. |
The original code does the |
The get is only done at the very last moment, when the hash is equal. Not much to be done about that. All weak/soft containers behave this way. Let's close this PR? |
This behavior was consistenly observed on the
syntax-role-modifiers
branch, but not when running the tests from the REPL, only when runningmvn test
:It is always during the second run that the bug triggers:
It is unclear to me what this "Run 2" means and why it is triggered. It is clear that the garbage collector seems to have cleaned up the type that we are looking for when we run the test again.