Repository navigation
refactor: stop renaming proxy fields when hashing - #424
Merged
Merged
Conversation
Since #396 the watchdog verifies a proxy by regenerating it with the running JDK under the same name and comparing both hashes in the same JVM, and the indexers no longer record proxies. Within one JVM the JDK numbers the Method fields of a proxy identically, so renaming them after their initializer and sorting the initializer blocks never changes a verdict. Only hashes of classes that extend java.lang.reflect.Proxy change. No BOMI contains such hashes, so existing BOMIs stay valid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #384.
Summary
HashComputerrenamed theMethodfields of every proxy class after the instructions in<clinit>that initialize them, and sorted those blocks of<clinit>. This made a proxy's checksum stable across JVM runs, which mattered while proxies were recorded in the BOMI.Since #396 that is no longer the case:
Within one JVM the JDK numbers the fields of a proxy identically, so the renaming never changes a verdict. This PR removes it.
Evidence
I generated the proxy of
java.beans.BeanPropertytwice per JVM, in separate JVM runs:-Xshare:off-Xshare:offor other names interned firstThe non-determinism across runs is real, but only within-run comparisons remain.