[COLLECTIONS-453] Clone input parameters for InstantiateTransformer.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1477838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
10a5e1c698
commit
05f3b74fd5
|
@ -70,8 +70,6 @@ public class InstantiateTransformer<T> implements Transformer<Class<? extends T>
|
||||||
if (paramTypes == null || paramTypes.length == 0) {
|
if (paramTypes == null || paramTypes.length == 0) {
|
||||||
return new InstantiateTransformer<T>();
|
return new InstantiateTransformer<T>();
|
||||||
}
|
}
|
||||||
paramTypes = paramTypes.clone();
|
|
||||||
args = args.clone();
|
|
||||||
return new InstantiateTransformer<T>(paramTypes, args);
|
return new InstantiateTransformer<T>(paramTypes, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,14 +85,16 @@ public class InstantiateTransformer<T> implements Transformer<Class<? extends T>
|
||||||
/**
|
/**
|
||||||
* Constructor that performs no validation.
|
* Constructor that performs no validation.
|
||||||
* Use <code>instantiateTransformer</code> if you want that.
|
* Use <code>instantiateTransformer</code> if you want that.
|
||||||
|
* <p>
|
||||||
|
* Note: from 4.0, the input parameters will be cloned
|
||||||
*
|
*
|
||||||
* @param paramTypes the constructor parameter types, not cloned
|
* @param paramTypes the constructor parameter types
|
||||||
* @param args the constructor arguments, not cloned
|
* @param args the constructor arguments
|
||||||
*/
|
*/
|
||||||
public InstantiateTransformer(final Class<?>[] paramTypes, final Object[] args) {
|
public InstantiateTransformer(final Class<?>[] paramTypes, final Object[] args) {
|
||||||
super();
|
super();
|
||||||
iParamTypes = paramTypes;
|
iParamTypes = paramTypes.clone();
|
||||||
iArgs = args;
|
iArgs = args.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue