/** * Creates and returns a deep copy of this object. * * @return a clone of this instance. */ public Object clone() { try { final Arguments ret = (Arguments) super.clone(); final Argument[] args = this.getArguments(); final Argument[] cloned = new Argument[ args.length ]; for ( int i = args.length - 1; i >= 0; i-- ) { cloned[i] = (Argument) args[i].clone(); } ret.setArguments( cloned ); return ret; } catch ( final CloneNotSupportedException e ) { throw new AssertionError( e ); } }
args.setArguments( (Argument[]) arguments.toArray( new Argument[ arguments.size() ] ) );