You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Digy (JIRA)" <ji...@apache.org> on 2008/11/15 02:28:48 UTC

[jira] Closed: (LUCENENET-8) Throwing an exception as a result of a normal situation is extremely bad in .net

     [ https://issues.apache.org/jira/browse/LUCENENET-8?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Digy closed LUCENENET-8.
------------------------

    Resolution: Invalid
      Assignee: Digy

I think, after 2 year,  this issue is invalid and can be closed. 


> Throwing an exception as a result of a normal situation is extremely bad in .net
> --------------------------------------------------------------------------------
>
>                 Key: LUCENENET-8
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-8
>             Project: Lucene.Net
>          Issue Type: Task
>         Environment: Windows XP, Visual Studio 2003
>            Reporter: Jo Inge Arnes
>            Assignee: Digy
>         Attachments: test.patch
>
>
> At the end of the FastCharStream.Refill() method, it says:
> int charsRead = input.Read(buffer, newPosition, buffer.Length - newPosition);
> if (charsRead <= 0)
>    throw new System.IO.IOException("read past eof");
> else
>    bufferLength += charsRead;
> When I run Lucene in the debugger, this causes an exception to be thrown all the time.
> To me it looks like it is thrown as a result of a normal situation, not because of some critical error.
> Is this correct?
> If this is the case, then the code is horrible. Throwing an exception in .NET is extremely slow, and should never be thrown as a result of a normal situation. I repeat: "extremely slow"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Closed: (LUCENENET-8) Throwing an exception as a result of a normal situation is extremely bad in .net

Posted by Ben Martz <be...@gmail.com>.
Is there an "official" place to store up-to-date patch files to resolve
these exceptions (is the issues archive really the right place)? I
completely understand that the changes are outside the scope of this project
since they change the fundamental operation of certain methods but resolving
the exceptions is mandatory if Lucene.Net is to be deployed in a production
environment. I also understand that, were I a new user, I _could_ search
through the issues archive to find old patch files that I could adapt but it
would be nice to have a page or something that formally addresses this issue
and provides up-to-date patch files to resolve the issue. This is not a
complaint mind you, but perhaps just food for thought.

Cheers,
Ben

On Fri, Nov 14, 2008 at 5:28 PM, Digy (JIRA) <ji...@apache.org> wrote:

>
>     [
> https://issues.apache.org/jira/browse/LUCENENET-8?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Digy closed LUCENENET-8.
> ------------------------
>
>    Resolution: Invalid
>      Assignee: Digy
>
> I think, after 2 year,  this issue is invalid and can be closed.
>
>
> > Throwing an exception as a result of a normal situation is extremely bad
> in .net
> >
> --------------------------------------------------------------------------------
> >
> >                 Key: LUCENENET-8
> >                 URL: https://issues.apache.org/jira/browse/LUCENENET-8
> >             Project: Lucene.Net
> >          Issue Type: Task
> >         Environment: Windows XP, Visual Studio 2003
> >            Reporter: Jo Inge Arnes
> >            Assignee: Digy
> >         Attachments: test.patch
> >
> >
> > At the end of the FastCharStream.Refill() method, it says:
> > int charsRead = input.Read(buffer, newPosition, buffer.Length -
> newPosition);
> > if (charsRead <= 0)
> >    throw new System.IO.IOException("read past eof");
> > else
> >    bufferLength += charsRead;
> > When I run Lucene in the debugger, this causes an exception to be thrown
> all the time.
> > To me it looks like it is thrown as a result of a normal situation, not
> because of some critical error.
> > Is this correct?
> > If this is the case, then the code is horrible. Throwing an exception in
> .NET is extremely slow, and should never be thrown as a result of a normal
> situation. I repeat: "extremely slow"
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
13:37 - Someone stole the precinct toilet. The cops have nothing to go on.
14:37 - Officers dispatched to a daycare where a three-year-old was
resisting a rest.
21:11 - Hole found in nudist camp wall. Officers are looking into it.