Fix field access flags preservation and module exports/opens relocation in RelocatorRemapper#1952
Conversation
Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Fix the issues |
…pper Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Fixed in commit 5c2104c. Two CI failures:
|
Two correctness bugs in the Class-File API-based
RelocatorRemapper:Field flags preserved:
withField(...)was not forwarding the original access flags (public,static,final, etc.), potentially emitting fields with incorrect modifiers. Fixed by usingwithField(String, ClassDesc, Consumer)and callingfb.withFlags(cle.flags().flagsMask())inside the lambda — necessary becauseClassBuilder.withFieldhas no(String, ClassDesc, int, Consumer)overload unlikewithMethod.Module
exports/opensrelocated:ModuleAttributehandling passedexports()andopens()through unchanged. These carry package names in internal format; if packages are relocated, the module descriptor would still reference pre-relocation packages, breaking JPMS at runtime. Fixed by remapping each entry viaPackageDesc.ofInternalName(map(...))and reconstructingModuleExportInfo/ModuleOpenInfo.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.