Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1918

FTS: NullPointerException when parsing date range facet response if one of the range endpoints is unbounded

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.2.6
    • None
    • None
    • 1

    Description

      Suggested release note text:

      Executing a  Full-Text Search query with an open-ended date range facet no longer results in a NullPointerException.

       

      The SearchDateRange constructor assumes the start and end arguments are non-null, but that's not true for open-ended ranges like:

      // everything on or after someInstant
      DateRange.create("myCoolRange", someInstant, null); 

      And as a result, 

      Caused by: java.lang.NullPointerException: text	at java.util.Objects.requireNonNull(Objects.java:228)	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1848)	at java.time.Instant.parse(Instant.java:395)	at com.couchbase.client.java.search.result.SearchDateRange.<init>(SearchDateRange.java:51)	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)	at com.couchbase.client.core.deps.com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:128)	at com.couchbase.client.core.deps.com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:291) 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          There are no comments yet on this issue.

          People

            david.nault David Nault
            david.nault David Nault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty