[code-reflection] RFR: Enable pattern matching for JavaType hierarchy
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Apr 26 17:56:25 UTC 2024
The `JavaType` hierarchy has now several types under it:
* `ClassType`
* `ArrayType`
* `PrimitiveType`
* `TypeVarRef`
* `WildcardType`
All these types are `public`, except `PrimitiveType`. This limits applicability of pattern matching.
In addition, `JavaType` defines a bunch of predicates:
* `isClass()`
* `isArray()`
* `isPrimitive()`
This set of predicates is now incomplete, as it doesn't support all the possible leaves in the type hierarchy.
Overall, it would be much better to just lean into pattern matching more, and drop the predicates.
-------------
Commit messages:
- Initial push
Changes: https://git.openjdk.org/babylon/pull/64/files
Webrev: https://webrevs.openjdk.org/?repo=babylon&pr=64&range=00
Stats: 99 lines in 7 files changed: 0 ins; 91 del; 8 mod
Patch: https://git.openjdk.org/babylon/pull/64.diff
Fetch: git fetch https://git.openjdk.org/babylon.git pull/64/head:pull/64
PR: https://git.openjdk.org/babylon/pull/64
More information about the babylon-dev
mailing list