drhaozhong opened a new issue, #12240:
URL: https://github.com/apache/lucene/issues/12240

   ### Description
   
   I find that my code fails to handle the failures of clones, when clones 
happen in queryparser. 
   
   I notice that lucene  hides CloneNotSupportedException, and throws 
RuntimeException. For example, CharArrayIterator has the following code:
   
   `public CharArrayIterator clone() {
       try {
         return (CharArrayIterator) super.clone();
       } catch (CloneNotSupportedException e) {
         // CharacterIterator does not allow you to throw CloneNotSupported
         throw new RuntimeException(e);
       }
     }`
   
   Due to the above observation, my code catches RuntimeException, and analyzes 
its embedded CloneNotSupportedException, when it needs to handle the failures 
of clones. 
   
   However, when I start to call queryparser, I find it does not hide 
CloneNotSupportedException. As a result, my code fails to catch failed clones 
when calling queryparser. 
   
   Will lucene fix the problem? If not, I will have to update all my handling 
code. 
   
   ### Version and environment details
   
   _No response_


-- 
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