/* (c) 2014 LinkedIn Corp. All rights reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
 * this file except in compliance with the License. You may obtain a copy of the
 * License at  http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied.
 */

package com.linkedin.uif.fork;

import org.apache.avro.Schema;

/**
 * A wrapper class for {@link org.apache.avro.Schema} that is also {@link Copyable}.
 *
 * @author ynli
 */
public class CopyableSchema implements Copyable<Schema> {

    private final Schema schema;

    public CopyableSchema(Schema schema) {
        this.schema = schema;
    }

    @Override
    public Schema copy() throws CopyNotSupportedException {
        return new Schema.Parser().parse(this.schema.toString());
    }
}

@@ -43,17 +43,16 @@
 rved.%0A *
- 
 %0A * Lice
@@ -268,17 +268,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -554,16 +554,17 @@
 chema;%0A%0A
+%0A
 /**%0A * A
@@ -726,18 +726,16 @@
 ema%3E %7B%0A%0A
-  
   privat
@@ -758,18 +758,16 @@
 chema;%0A%0A
-  
   public
@@ -803,20 +803,16 @@
 ) %7B%0A    
-  
-  
 this.sch
@@ -829,17 +829,13 @@
 ma;%0A
-  
   %7D%0A%0A
-  
   @O
@@ -842,18 +842,16 @@
 verride%0A
-  
   public
@@ -864,16 +864,22 @@
 a copy()
+%0A     
  throws 
@@ -910,20 +910,16 @@
 n %7B%0A    
-   
- 
 return n
@@ -937,16 +937,35 @@
 arser().
+setValidate(false).
 parse(th
@@ -987,16 +987,14 @@
 ing());%0A
-  
   %7D%0A%7D%0A

Set validation to false when copying a schema