@@ -305,6 +305,11 @@ public static <A extends Annotation> void prepareForUse(
305305 Consumer <Properties > configBaseline ,
306306 BiConsumer <A ,Properties > configExtractor ,
307307 GeneratorCreationContext creationContext ) {
308+ if ( generator instanceof AnnotationBasedGenerator ) {
309+ @ SuppressWarnings ("unchecked" )
310+ final AnnotationBasedGenerator <A > generation = (AnnotationBasedGenerator <A >) generator ;
311+ generation .initialize ( annotation , idMember .toJavaMember (), creationContext );
312+ }
308313 if ( generator instanceof Configurable configurable ) {
309314 final Properties properties = new Properties ();
310315 if ( configBaseline != null ) {
@@ -323,14 +328,6 @@ public static <A extends Annotation> void prepareForUse(
323328 }
324329 configurable .configure ( creationContext , properties );
325330 }
326- if ( generator instanceof AnnotationBasedGenerator ) {
327- // This will cause a CCE in case the generation type doesn't match the annotation type; As this would be
328- // a programming error of the generation type developer and thus should show up during testing, we don't
329- // check this explicitly; If required, this could be done e.g. using ClassMate
330- @ SuppressWarnings ("unchecked" )
331- final AnnotationBasedGenerator <A > generation = (AnnotationBasedGenerator <A >) generator ;
332- generation .initialize ( annotation , idMember .toJavaMember (), creationContext );
333- }
334331 if ( generator instanceof ExportableProducer exportableProducer ) {
335332 exportableProducer .registerExportables ( creationContext .getDatabase () );
336333 }
0 commit comments