How to clone a derivated class of ArrayList

How to clone a derivated class of ArrayList

Post by mikegreonl » Fri, 24 Oct 2003 06:54:18


I used the following code, it compiled and ran cleanly:

package ConsoleApplication1;

import java.util.ArrayList;
import java.lang.Cloneable;

public class MyClass1 extends ArrayList implements Cloneable
{
public MyClass1()
{
//
// TODO: Add Constructor Logic here
//
}

public Object clone()
{
MyClass1 obj = (MyClass1) super.clone();
return obj;
}
}


package ConsoleApplication1;

import ConsoleApplication1.MyClass1;

/**
* Summary description for Class1.
*/
public class Class1
{
public Class1()
{
//
// TODO: Add Constructor Logic here
//
}

/** @attribute System.STAThread() */
public static void main(String[] args)
{
MyClass1 c1 = new MyClass1();
MyClass1 c2 = (MyClass1) c1.clone();
}
}


Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.
 
 
 

How to clone a derivated class of ArrayList

Post by mikegreonl » Sun, 26 Oct 2003 07:32:20

I will have our lab set up a machine to try to reproduce this error. Are
you running under the French version of Windows XP as well as Visual
Studio.Net 2003?


Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.

 
 
 

How to clone a derivated class of ArrayList

Post by anonymou » Wed, 29 Oct 2003 00:42:45

Yes, I'm running under Microsoft Windows XP Professionel
Version 2002. 5.1.2600 Nu2600

Microsoft Development Environment 2003 Version 7.1.3088
Microsoft .NET Framework 1.1 Version 1.1.4322


this error. Are
well as Visual
confers no rights.
 
 
 

How to clone a derivated class of ArrayList

Post by mikegreonl » Wed, 29 Oct 2003 09:49:31

Excellent. I will have our lab set it up and I'll get back to you as soon
as I can.

Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.
 
 
 

How to clone a derivated class of ArrayList

Post by mikegreonl » Fri, 31 Oct 2003 09:03:45

I am able to reproduce the problem and I have submitted a bug report to the
development team.

Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.