package com.conger.test.r3;

public class CloneTest implements Cloneable
{
    private String status;

    private Test ttt;
    private TestTest sss;
    
    private TestTest[] sa;
    private Test[] ta;
    
    
    public static void main(String[] args) throws CloneNotSupportedException
    {
        CloneTest ct = new CloneTest();
        ct.ttt = new Test();
        ct.ttt.hello = 4;
        ct.status = "1";
        ct.sss = new TestTest();
        ct.sss.hello = 3;
        ct.ta = new Test[]{new Test()};
        ct.sa = new TestTest[]{new TestTest()};
        
        System.out.println(ct);
        CloneTest t = (CloneTest) ct.clone();
        System.out.println(t);
        
        System.out.println(ct.ta.clone()[0]);
        System.out.println(t.ta.clone()[0]);
        
        System.out.println(ct.sa[0]);
        System.out.println(t.sa[0]);
    }
    
    public String toString()
    {
        return status + " " + ttt.hello + " " + sss.hello + " " + ttt + " " + sss;
    }
    
    @Override
    public Object clone() throws CloneNotSupportedException
    {
        CloneTest t = (CloneTest) super.clone();
        t.sss = t.sss.clone();
        return t;
    }
}

class Test
{
    public int hello = 0;
}

class TestTest implements Cloneable
{
    public int hello = 0;
    
    @Override 
    public TestTest clone() throws CloneNotSupportedException
    {
        return (TestTest) super.clone();
    }
    
}
@@ -22,16 +22,45 @@
 st.r3;%0A%0A
+import java.util.ArrayList;%0A%0A
 public c
@@ -229,24 +229,197 @@
 %5B%5D ta;%0A    %0A
+    private static final TestTest%5B%5D PRIVATE_VALUES =%0A    %7B new TestTest() %7D;%0A%0A    public static final TestTest%5B%5D values()%0A    %7B%0A        return PRIVATE_VALUES.clone();%0A    %7D%0A
     %0A    pub
@@ -1059,24 +1059,192 @@
 n(t.sa%5B0%5D);%0A
+        %0A        System.out.println(CloneTest.values()%5B0%5D);%0A        CloneTest.values()%5B0%5D = new TestTest();%0A        System.out.println(CloneTest.values()%5B0%5D);%0A        %0A
     %7D%0A    %0A 
@@ -1515,16 +1515,27 @@
  t.sss =
+ (TestTest)
  t.sss.c
@@ -1706,23 +1706,21 @@
  public 
-TestTes
+Objec
 t clone(
@@ -1775,27 +1775,16 @@
   return
- (TestTest)
  super.c
@@ -1803,8 +1803,10 @@
 %7D%0A    %0A%7D
+%0A%0A

edit clone test