tkobayas opened a new issue, #7213: URL: https://github.com/apache/incubator-kie/issues/7213
## Description Annotation processing for type declarations is spread across multiple places: 1. `TypeDeclarationFactory.processTypeDeclaration()` — pre-populates from Java, then DRL overrides 2. `TypeDeclarationFactory.processAnnotations()` — handles `@TypeSafe` and Kind from DRL 3. `TypeDeclarationConfigurator.wireFieldAccessors()` — composite `Annotated.withFallback(DRL, Java)` re-processes all annotations and creates extractors This leads to `@Role` and `@PropertyChangeSupport` being processed multiple times, and comments are needed to explain why each step exists. ## Proposed refactoring Consolidate all annotation merging into `processTypeDeclaration()`: 1. `processTypeAnnotations()` handles all annotations (add `configureTimestampAttribute`, `configureDurationAttribute`) 2. `processTypeDeclaration()` creates a single merged `Annotated` (DRL + Java) and calls `processTypeAnnotations()` once 3. `processAnnotations()` simplifies to `@TypeSafe` + Kind only 4. `wireFieldAccessors()` only creates extractors from values already set on `TypeDeclaration` — no composite Annotated, no `processTypeAnnotations()` call ### Result - Annotation merging happens in one place - `wireFieldAccessors()` only does what its name says - No redundant re-processing - Net: ~57 insertions, ~80 deletions ## Context Detailed diff and analysis documented in `Refactor_Annotation.md` on the `align-annotation` branch, created during [#7185](https://github.com/apache/incubator-kie/issues/7185) / [PR #7186](https://github.com/apache/incubator-kie/pull/7186). -- 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]
