[
https://issues.apache.org/jira/browse/LUCENENET-103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12535675
]
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: https://issues.apache.org/jira/browse/LUCENENET-103
> Project: Lucene.Net
> Issue Type: Improvement
> Environment: C# 2.0
> Reporter: Jon Davis
> Priority: Minor
>
> IClonable needs to be added to Lucene.net's RAMDirectory.
> See Lucene (Java) item resolution at:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg03725.html
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.