Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2815

AnnotatedTypes#createTypeId doesn't handle array annotation values properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.1.5.Final, 6.0.2.Final
    • None
    • None

      While creating an ID for annotated types, Weld will try to create a String representation that contains type, methods, c-tors and all of their annotations.
      However, the annotation values can be misrepresented if there are any arrays in them.

      An example is trying to create this ID for a type that uses @Produces(MediaType.APPLICATION_JSON) which has an array value in it.
      Weld will create an ID that ends with something like this: ...@jakarta.ws.rs.Produces(value=[Ljava.lang.String;@60f33f97)]();}

      This then interferes with any hash code and equals that the ID might be used for.

      Fix is to take into consideration these values and write them out into the final String.
      A draft can be seen here - https://github.com/weld/core/compare/5.1...manovotn:core:fixAnnotatedTypeIdCreation?expand=1

              manovotn Matěj Novotný
              manovotn Matěj Novotný
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: