tkobayas commented on code in PR #7186:
URL: https://github.com/apache/incubator-kie/pull/7186#discussion_r4291472147
##########
drools-compiler/src/main/java/org/drools/compiler/builder/impl/TypeDeclarationFactory.java:
##########
@@ -71,6 +73,15 @@ public TypeDeclaration processTypeDeclaration(
PackageRegistry pkgRegistry,
type.setTypeClass( existingClass );
type.setNovel( existingClass == null );
type.setNature( existingClass == null ?
TypeDeclaration.Nature.DEFINITION : TypeDeclaration.Nature.DECLARATION );
+
+ // Pre-populate from Java class annotations so that
finalizeConfigurator()
+ // (which runs before wireFieldAccessors) sees the correct role,
expiration,
+ // reactivity, and dynamic settings. DRL annotations applied next
will override.
+ if ( existingClass != null ) {
+ TypeDeclaration.processTypeAnnotations( type,
+ new Annotated.ClassAdapter( existingClass ),
+ context.getBuilderConfiguration().getOption(
PropertySpecificOption.KEY ) );
+ }
Review Comment:
The annotation processing logic is spread across several places, making it a
bit difficult to follow. This PR focuses on the fix itself. I'll submit a
separate PR for refactoring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]