AOT repository fragment generation fails with a custom QueryEnhancerSelector
Configuring a custom QueryEnhancerSelector through @EnableJpaRepositories causes AOT repository fragment generation to fail.
Steps to reproduce
-
Implement a custom QueryEnhancerSelector that delegates to QueryEnhancerSelector.DEFAULT_SELECTOR.
-
Configure it using @EnableJpaRepositories(queryEnhancerSelector = CustomQueryEnhancerSelector.class).
-
Generate the repository's AOT fragment.
Expected behavior
AOT repository fragment generation succeeds with the configured selector.
Actual behavior
Generation fails with:
The exception originates from JpaRepositoryContributor.customizeConstructor(), which uses T$ instead of the JavaPoet type placeholder $T:
Verification
Reproduced on 4.2.0-SNAPSHOT at commit effece10 with a regression test in JpaRepositoryContributorConfigurationTests. Replacing T$ with $T allows the test to generate, compile, and instantiate the AOT fragment successfully.