Added safe copy of array. 77/10777/1
authorLukas Sedlak <lsedlak@cisco.com>
Thu, 4 Sep 2014 13:25:48 +0000 (15:25 +0200)
committerLukas Sedlak <lsedlak@cisco.com>
Thu, 4 Sep 2014 13:25:48 +0000 (15:25 +0200)
In class c-tor ParametrizedTypeImpl added safe copy of Types array instead of direct assigment.

Change-Id: I31c5f62faeca76238701465ca71f72e76f4d0701
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
code-generator/binding-generator-util/src/main/java/org/opendaylight/yangtools/binding/generator/util/Types.java

index a6a5ef5a41b699899a42c2a7d1cb615fcc65c5c6..91d56a3562bbcfcdff2f62e263c46e7e05fc3085 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.yangtools.binding.generator.util;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -251,7 +252,7 @@ public final class Types {
         public ParametrizedTypeImpl(Type rawType, Type[] actTypes) {
             super(rawType.getPackageName(), rawType.getName());
             this.rawType = rawType;
-            this.actualTypes = actTypes;
+            this.actualTypes = Arrays.copyOf(actTypes, actTypes.length);
         }
 
     }