Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1400#discussion_r98356528
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
 ---
    @@ -72,6 +77,27 @@ public AbstractReportingTaskNode(final ReportingTask 
reportingTask, final String
             this.reportingTask = reportingTask;
             this.processScheduler = processScheduler;
             this.serviceLookup = controllerServiceProvider;
    +
    +        final Class<?> reportingClass = reportingTask.getClass();
    +
    +        try {
    +            if (reportingClass.isAnnotationPresent(DefaultSchedule.class)) 
{
    +                DefaultSchedule dsc = 
reportingClass.getAnnotation(DefaultSchedule.class);
    --- End diff --
    
    I am wondering if we should instead use Spring's AnnotationUtils and its 
discovery operations there. Basically the question is if you *only* looking for 
annotation in the specific class _reportingTask.getClass()_, then the above is 
OK i guess, but I am afraid that if impl of the ReportingTask has a more 
complex hierarchy and annotated operation is in some super class, then the 
above will not work. WDYT?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to