> The ClassFile API promotes usage of constant nominal descriptors over literal > strings. However, for `class` file parsing, currently the efficient way to > check if a constant pool entry matches a desired descriptor is via unrolling > them back to strings. However, string unrolling is ugly, and often times > confusing, such as internal names versus field descriptors. > > As a result, I propose to provide new methods that compare constant pool > entries with the potential symbolic descriptors they represent. This is no > less efficient as checking raw string equality, avoids exceptional failure > behaviors of conversion to symbolic descriptors, and avoids potential > programmer errors stemming from raw string handling. See the CSR for a full > story.
Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Rename UTF8 test methods to be different from other test methods - Merge branch 'master' of https://github.com/openjdk/jdk into feature/cf-equals-sym - 8342206: Convenience method to check if a constant pool entry matches nominal descriptors ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23548/files - new: https://git.openjdk.org/jdk/pull/23548/files/4e73380c..dd3adbc9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23548&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23548&range=00-01 Stats: 450585 lines in 6096 files changed: 149618 ins; 269944 del; 31023 mod Patch: https://git.openjdk.org/jdk/pull/23548.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23548/head:pull/23548 PR: https://git.openjdk.org/jdk/pull/23548