lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Davis (JIRA)" <>
Subject [jira] Commented: (LUCENENET-103) Need to implement ICloneable on RAMDirectory
Date Wed, 17 Oct 2007 19:01:50 GMT


Jon Davis commented on LUCENENET-103:

> First, although I couldn't generate an error in "Clone(false)" case, I think it can be
dangerous since it does not clone the byte array, instead just put the address into the buffer(and
this is the reason of speed-up).

Unsafe, not dangerous. It's the same principle as using unsafe pointers in C#. But yes, that
is the nature of any shallow clone, and that's why I implemented a deep clone as well. People
shouldn't use shallow clones unless they know what they are doing. That said, does Lucene's
analyzers perform any writes/modifications to a Directory when the "user" is only reading
a Directory?

The version I'm using (released build v2 from April, not from CVS) doesn't have sizeInBytes,
it has length. I only considered Directory.Copy after you suggested getting it from CVS. For
that matter, my test results differ from yours, and so perhaps some of this issue is moot
as I should have checked to see what's in CVS before posting.

> Need to implement ICloneable on RAMDirectory
> --------------------------------------------
>                 Key: LUCENENET-103
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Improvement
>         Environment: C# 2.0
>            Reporter: Jon Davis
>            Priority: Minor
> IClonable needs to be added to's RAMDirectory.
> See Lucene (Java) item resolution at: 

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

View raw message