[ 
https://issues.apache.org/jira/browse/SOLR-11879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16338492#comment-16338492
 ] 

Yonik Seeley edited comment on SOLR-11879 at 1/25/18 12:46 AM:
---------------------------------------------------------------

bq. The EOFException is actually a signaling mechanism. It's not really an 
exception

It depends on the user context, not on FastInputStream.

I do see the following code in JavabinLoader:
{code}
    FastInputStream in = FastInputStream.wrap(stream);
    for (; ; ) {
      try {
        update = new JavaBinUpdateRequestCodec().unmarshal(in, handler);
      } catch (EOFException e) {
        break; // this is expected
      }
{code}

It's bad practice to use exceptions as signaling... I assume there should be an 
easy way to avoid doing so here?



was (Author: [email protected]):
bq. The EOFException is actually a signaling mechanism. It's not really an 
exception

It depends on context.  For this specific class (FastInputStream), do we have 
code (i.e. uses of FastInputStream) that cause an exception to be thrown in 
non-error cases?

> avoid creating a new Exception object for EOFException in FastinputStream
> -------------------------------------------------------------------------
>
>                 Key: SOLR-11879
>                 URL: https://issues.apache.org/jira/browse/SOLR-11879
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>         Environment: FastI
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>            Priority: Trivial
>         Attachments: SOLR-11879.patch
>
>
> FastInputStream creates and throws a new EOFException, every time an end of 
> stream is encountered. This is wasteful as we never use the stack trace 
> anywhere 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to