Thank you all for your input. However, this is what I have discovered so
far:
- I tried running the test that Edwin suggested and it failed for me in
my environment (Lucene 2.3.2, Windows XP, SUN JDK 1.5 or 1.6)
e.g. SegmentInfos sis = new SegmentInfos();
SegmentInfos sis2 = (SegmentInfos) sis.clone();
- Interestingly, I tried to create a dummy test class which mimics
SegmentInfos as follows and it works!:
public class TestVector extends Vector
{
public TestVector clone()
{
TestVector cl = (TestVector)super.clone();
return cl;
}
}
TestVector vector = new TestVector();
TestVector vClone = (TestVector)vector.clone();
- This tells me that perhaps there is something wrong with the lucene
package that I have downloaded (some sort of incompatibility?). I will try
to recompile the lucene package in my own environment and see if I can fix
the problem.
On Sat, Oct 4, 2008 at 2:21 AM, Edwin Lee <[EMAIL PROTECTED]> wrote:
> i think, very likely, you have another copy of java.util.Vector loaded, and
> this one tries to be too clever with its implementation of clone
> (instantiate a
> new Vector instance) instead of delegating to its super class (Object).
>
>
>
> HTH,
> Edwin
>
>
>
> --- Chris Hostetter <[EMAIL PROTECTED]> wrote:
>
> >
> > : SegmentInfos sis = (SegmentInfos) super.clone();
> >
> > : We see that it is trying to cast a Vector into SegmentInfos which
> explains
> > : the ClassCastException. This is definitely a bug.
> >
> > I'm really not sure how you could be getting that ClassCastException
> > unless there's a really horrific bug in the JRE you are using.
> >
> > You'll see this in just about every (non-trivial) use of super.clone()
> ...
>
>
>
> Yahoo! Toolbar is now powered with Search Assist.Download it now!
> http://sg.toolbar.yahoo.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>