lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush (JIRA)" <>
Subject [jira] Commented: (LUCENENET-8) Throwing an exception as a result of a normal situation is extremely bad in .net
Date Tue, 10 Oct 2006 02:04:25 GMT
    [ ] 
George Aroush commented on LUCENENET-8:

Hi folks,

I have submitted this issue as a question to the Java Lucene folks (you can see the email
thread about it here:
(scan for FastCharStream.refill as the email subject.)

It turned out that this is an issue for Java Lucene as well and it has been fixed for 2.0.1

Given that Java Lucene 2.0.1 is not officially released, and that I am still trying to get
Lucene.Net 2.0 out, I will hold off doing any work on this issue.

I would add, once 2.0.1 is officially released, this change will be part of Lucene.Net 2.0.1,


-- George Aroush

> Throwing an exception as a result of a normal situation is extremely bad in .net
> --------------------------------------------------------------------------------
>                 Key: LUCENENET-8
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Task
>         Environment: Windows XP, Visual Studio 2003
>            Reporter: Jo Inge Arnes
>         Assigned To: George Aroush
>         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.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message