Beehive
  1. Beehive
  2. BEEHIVE-990

Controls Annotation processor throws null pointer exception when an annotation type cannot be resolved

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.1
    • Component/s: Controls
    • Labels:
      None

      Description

      If an annotation type cannot be resolved by the controls annotation processor, a null pointer exception is thrown by the annotation processor. This would typically happen when the import for the annotation was not added to the source file.

      Need to update AnnotationConstraintAptValidator to handle this case correctly.

      1. BEEHIVE-990.patch
        1 kB
        Chad Schoettger

        Activity

        Hide
        matt c added a comment -

        Verified fixed using local beehive build synced to SVN 393036 by adding an erroneous annotation to an interface and confirming the compiler error.

        added the annotation '@NotAnAnno' to a control at the class and again at the method level. In both cases a 'cannot find symbol' error was given.

        [apt] D:\beehive\trunk\controls\test\src\controls\org\apache\beehive\contr
        ols\test\controls\myTests\SubHello.java:38: cannot find symbol
        [apt] symbol : class NotAnAnno
        [apt] location: interface org.apache.beehive.controls.test.controls.myTest
        s.SubHello
        [apt] @NotAnAnno

        This bug may be closed.

        Show
        matt c added a comment - Verified fixed using local beehive build synced to SVN 393036 by adding an erroneous annotation to an interface and confirming the compiler error. added the annotation '@NotAnAnno' to a control at the class and again at the method level. In both cases a 'cannot find symbol' error was given. [apt] D:\beehive\trunk\controls\test\src\controls\org\apache\beehive\contr ols\test\controls\myTests\SubHello.java:38: cannot find symbol [apt] symbol : class NotAnAnno [apt] location: interface org.apache.beehive.controls.test.controls.myTest s.SubHello [apt] @NotAnAnno This bug may be closed.
        Hide
        Eddie O'Neil added a comment -

        Fixed in SVN 331882. Couldn't quite use the provided patch because the AP should be more failure-resistant and shouldn't throw an exception. Just changed the for {} loop to continue when the type can't be found.

        Show
        Eddie O'Neil added a comment - Fixed in SVN 331882. Couldn't quite use the provided patch because the AP should be more failure-resistant and shouldn't throw an exception. Just changed the for {} loop to continue when the type can't be found.
        Hide
        Chad Schoettger added a comment -

        Attached patch.

        Fixed code to properly handle NPE from APT call.

        Show
        Chad Schoettger added a comment - Attached patch. Fixed code to properly handle NPE from APT call.

          People

          • Assignee:
            Eddie O'Neil
            Reporter:
            Chad Schoettger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development