Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-11530

Annotated setter parameters handled wrong in schema creation

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Flags:
      Important

      Description

      I'm facing an exception telling me that my JavaBean contained a setter for a field that had a mismatching nullable attribute, although both getter and setter (parameters) are annotated with @Nullable.

       

      The code responsible for determining if a setter's parameter is nullable looks wrong to me, since it does check if the type (class) itself is annotated with @Nullable instead of checking the actual parameter's annotations only considers type annotations instead of looking at parameter annotations, too. Java distinguishes between parameter annotations and type annotations. Therefore annotations declared without java.lang.annotation.ElementType#TYPE_USE can't be accessed through Executable#getAnnotatedParameterTypes().

       

      FieldValueTypeInformation

      boolean nullable =
        Arrays.stream(method.getParameters()[0].getAnnotatedType().getAnnotations())
              .anyMatch(annotation -> isNullableAnnotation(annotation));

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              krakowski Filip Krakowski

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 50m
                3h 50m

                  Issue deployment