@Test public void testClone() throws Exception { TransExecutorParameters meta = new TransExecutorParameters(); meta.setField( new String[] { "field1", "field2" } ); meta.setVariable( new String[] { "var1", "var2" } ); meta.setInput( new String[] { "input1", "input2" } ); TransExecutorParameters cloned = (TransExecutorParameters) meta.clone(); assertFalse( cloned.getField() == meta.getField() ); assertTrue( Arrays.equals( cloned.getField(), meta.getField() ) ); assertFalse( cloned.getVariable() == meta.getVariable() ); assertTrue( Arrays.equals( cloned.getVariable(), meta.getVariable() ) ); assertFalse( cloned.getInput() == meta.getInput() ); assertTrue( Arrays.equals( cloned.getInput(), meta.getInput() ) ); }
@Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.arraycopy( field, 0, retval.field, 0, nrVariables ); System.arraycopy( input, 0, retval.input, 0, nrVariables ); return retval; } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } }
TransExecutorParameters implements Cloneable { @Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.arraycopy( field, 0, retval.field, 0, nrVariables ); System.arraycopy( input, 0, retval.input, 0, nrVariables ); return retval; } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } } }
TransExecutorParameters implements Cloneable { @Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.arraycopy( field, 0, retval.field, 0, nrVariables ); System.arraycopy( input, 0, retval.input, 0, nrVariables ); return retval; } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } } TransExecutorParameters();  TransExecutorParameters( Node paramNode );  TransExecutorParameters( Repository rep, ObjectId id_step ); }
TransExecutorParameters implements Cloneable { @Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.arraycopy( field, 0, retval.field, 0, nrVariables ); System.arraycopy( input, 0, retval.input, 0, nrVariables ); return retval; } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } } TransExecutorParameters();  TransExecutorParameters( Node paramNode );  TransExecutorParameters( Repository rep, ObjectId id_step ); void allocate( int nrVariables ); @Override Object clone(); String getXML(); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); String[] getField(); void setField( String[] field ); String[] getVariable(); void setVariable( String[] variable ); boolean isInheritingAllVariables(); void setInheritingAllVariables( boolean inheritingAllVariables ); String[] getInput(); void setInput( String[] input ); }
TransExecutorParameters implements Cloneable { @Override public Object clone() { try { TransExecutorParameters retval = (TransExecutorParameters) super.clone(); int nrVariables = variable.length; retval.allocate( nrVariables ); System.arraycopy( variable, 0, retval.variable, 0, nrVariables ); System.arraycopy( field, 0, retval.field, 0, nrVariables ); System.arraycopy( input, 0, retval.input, 0, nrVariables ); return retval; } catch ( CloneNotSupportedException e ) { throw new RuntimeException( e ); } } TransExecutorParameters();  TransExecutorParameters( Node paramNode );  TransExecutorParameters( Repository rep, ObjectId id_step ); void allocate( int nrVariables ); @Override Object clone(); String getXML(); void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ); String[] getField(); void setField( String[] field ); String[] getVariable(); void setVariable( String[] variable ); boolean isInheritingAllVariables(); void setInheritingAllVariables( boolean inheritingAllVariables ); String[] getInput(); void setInput( String[] input ); static final String XML_TAG; }