Beehive
  1. Beehive
  2. BEEHIVE-386

TwoPhaseAnnotationProcessor processing algorithm is suboptimal

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: V1Alpha
    • Fix Version/s: None
    • Component/s: Controls
    • Labels:
      None

      Description

      TPAP currently uses the following loop:

      for ( all annotations that a processor is registered to handle )
      get collection of decls annotated with a particular annotation
      check that decl

      This means that a decl could be checked multiple times, if it has multiple interesting annotations on it. Furthermore, each check pass currently has no context being passed wrt what annotation the TPAP considers interesting (the "check that decl" call above doesn't pass the annotation in question). We should add that to the signature.

      This labelled as task-level work because it could cause some significant ripple effects on downstream processors.

      A workaround for this that we've been using has been to have annotation processors register for a minimal set of annotations, and internally do explicit checks for other annotations. This makes it difficult to be comprehensive about robustly covering error cases for annotation usage (since situations where we didn't explicitly expect to see an annotation will probably just be ignored), and it also means apt reports a ton of annotations as not having any processors registered for it. See http://issues.apache.org/jira/browse/BEEHIVE-385.

        Activity

        Hide
        Kenneth Tam added a comment -

        I don't see a compelling reason to embark on this rearchitecture of the AP framework at this time when stability is a high priority.

        Show
        Kenneth Tam added a comment - I don't see a compelling reason to embark on this rearchitecture of the AP framework at this time when stability is a high priority.

          People

          • Assignee:
            Kenneth Tam
            Reporter:
            Kenneth Tam
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development