lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug (JIRA)" <>
Subject [jira] Commented: (LUCENENET-8) Throwing an exception as a result of a normal situation is extremely bad in .net
Date Wed, 07 Mar 2007 23:07:24 GMT


Doug commented on LUCENENET-8:

This project has always followed the ideal of being a direct port of Java Lucene, and while
the project is in its infancy, I think it would be better to stay that way.

By nature of the project, anyone interested in the issues is free to apply patches to their
own installations. And this is definitely the place to discuss those issues, but as for changing
the direction of the core project, I think thats better left to when there are many more active
members contributing.

Perhaps then it will be time for a branch to be maintained by enthusiastic volunteers prepared
to invest the time in creating releases more independent of the Java project, one that follows
.Net best practices and conventions. 

For now I think the project needs to maintain course. IMO of course!

> 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.
You can reply to this email to add a comment to the issue online.

View raw message