Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-386

TwoPhaseAnnotationProcessor processing algorithm is suboptimal

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • V1Alpha
    • None
    • Controls
    • 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.

      Attachments

        Activity

          People

            kentam Kenneth Tam
            kentam Kenneth Tam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: