Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-13252

NullPointerException in AnnotationDeclaration.validateNamedValue

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 4.0.0.CR1
    • 4.0.0.Beta2
    • cdi, common
    • Hide

      Create an annotation type

      @Target({ElementType.TYPE})
      public @interface MyAnnotation {
          String[] value();
      }
      

      and add it to a type with null element

      @MyAnnotation({null})
      public class C {
      }
      

      In this case, method validateNamedValue gets parameter value=null and fails at line

      String stringValue = value.toString();

      Show
      Create an annotation type @Target({ElementType.TYPE}) public @ interface MyAnnotation { String [] value(); } and add it to a type with null element @MyAnnotation({ null }) public class C { } In this case, method validateNamedValue gets parameter value=null and fails at line String stringValue = value.toString();
    • Hide

      If the issue is caused by an error in annotation, fix it.

      Show
      If the issue is caused by an error in annotation, fix it.

    Description

      https://community.jboss.org/message/780126

      Comment to method IMemberValuePair.getValue() says that it may return null.
      There is no check for null in AnnotationDeclaration.validateNamedValue.

      Attachments

        Issue Links

          Activity

            People

              manderse@redhat.com Max Andersen
              scabanovich Viacheslav Kabanovich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: