Skip to content
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

Introduce RuntimeHints predicates utilities #28555

Closed
bclozel opened this issue Jun 2, 2022 · 0 comments
Closed

Introduce RuntimeHints predicates utilities #28555

bclozel opened this issue Jun 2, 2022 · 0 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@bclozel
Copy link
Member

bclozel commented Jun 2, 2022

The new RuntimeHints API allows to describe hints for the reflection/proxies/resources needs at runtime.
The problem is, a single invocation at runtime can be covered by multiple, different hints.

For example, reflection introspection on the myMethod method for the class MyClass can be covered by any of:

  • MemberCategory.INTROSPECT_PUBLIC_METHODS if myMethod is public
  • MemberCategory.INVOKE_PUBLIC_METHODS if myMethod is public
  • MemberCategory.INTROSPECT_DECLARED_METHODS in all cases
  • MemberCategory.INVOKE_DECLARED_METHODS in all cases
  • a specific introspection or invokation reflection entry for MyClass::myMethod

Because of the knowledge required for checking if registered hints are enough for a particular use case, we should introduce Predicate<RuntimeHints> static utilities to be used in tests and in #27981

@bclozel bclozel added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Jun 2, 2022
@bclozel bclozel added this to the 6.0.0-M5 milestone Jun 2, 2022
@bclozel bclozel self-assigned this Jun 2, 2022
bclozel added a commit that referenced this issue Jun 13, 2022
This commit adds a method variant checking that all `MemberCategory` are
supported by the `RuntimeHints` for a given type hint.

See gh-28555
bclozel added a commit that referenced this issue Jun 14, 2022
As of #28620, `ResourcePatternHint` exposes its `toRegex` method.
The predicates should use it directly and mirror the exact matching
behavior.

See gh-28555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant