Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-1286

FilterImpl.getStringValue() does not use custom converter class specified in @Field annotation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.5
    • jackrabbit-ocm
    • None
    • jackrabbit-ocm-1.4-20071210.145858-1
      java version "1.5.0_13"

    Description

      I have a POJO with the following field:

      @Field(converter = LocaleConverter.class)
      private Locale locale;

      When I attempt to query for objects based on this field, I get a NullPointerException:

      java.lang.NullPointerException
      at org.apache.jackrabbit.ocm.query.impl.FilterImpl.getStringValue(FilterImpl.java:281)
      at org.apache.jackrabbit.ocm.query.impl.FilterImpl.addEqualTo(FilterImpl.java:129)

      FilterImpl should preferentially use the atomic type converter defined in the @Field annotation to convert the value, then fallback to the global converters. Converting the Locale to a string for use in the query is a workaround, but the logic for string conversion should only reside in my LocaleConverter class.

      Attachments

        Activity

          People

            clombart Christophe Lombart
            pegli Paul Mietz Egli
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: