jhinch-at-atlassian-com opened a new issue, #14161:
URL: https://github.com/apache/lucene/issues/14161

   ### Description
   
   PointInSetQuery in its constructor will check if the values provided to it 
are in order and if not will attempt to throw an exception:
   
   ```
             throw new IllegalArgumentException(
                 "values are out of order: saw " + previous + " before " + 
current);
   ```
   
   However instead of this exception, the following exception is thrown:
   
   ```
   java.lang.UnsupportedOperationException
        at 
org.apache.lucene.util.BytesRefBuilder.hashCode(BytesRefBuilder.java:172)
        at java.base/java.lang.Object.toString(Object.java:256)
        at 
java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:453)
        at 
org.apache.lucene.search.PointInSetQuery.<init>(PointInSetQuery.java:116)
   ```
   
   This is because `previous` is a `BytesRefBuilder` which does not support the 
`hashCode()` method which is used by the default `toString()` method.
   
   Either `BytesRefBuilder` should be updated to allow for `toString()` to be 
invoked on it or the code should be modified to retrieve the `BytesRef` within 
the `BytesRefBuilder` so that the correct exception is thrown
   
   ### Version and environment details
   
   * JDK 21
   * Lucene 9.11.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to