Improve registration of the same hint for multiple classes
Based on the feedback in #28977 an easy way to create a list of type references based on a vararg of classes is helpful when registering the same hints for several types.
This commit is contained in:
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.springframework.transaction.annotation;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.aot.hint.MemberCategory;
|
||||
import org.springframework.aot.hint.RuntimeHints;
|
||||
import org.springframework.aot.hint.RuntimeHintsRegistrar;
|
||||
@@ -38,11 +36,8 @@ class TransactionRuntimeHints implements RuntimeHintsRegistrar {
|
||||
@Override
|
||||
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
|
||||
RuntimeHintsUtils.registerSynthesizedAnnotation(hints, Transactional.class);
|
||||
hints.reflection()
|
||||
.registerTypes(List.of(
|
||||
TypeReference.of(Isolation.class),
|
||||
TypeReference.of(Propagation.class),
|
||||
TypeReference.of(TransactionDefinition.class)),
|
||||
builder -> builder.withMembers(MemberCategory.DECLARED_FIELDS));
|
||||
hints.reflection().registerTypes(TypeReference.listOf(
|
||||
Isolation.class, Propagation.class, TransactionDefinition.class),
|
||||
builder -> builder.withMembers(MemberCategory.DECLARED_FIELDS));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user