Author: sebb Date: Wed Apr 29 00:45:08 2009 New Revision: 769603 URL: http://svn.apache.org/viewvc?rev=769603&view=rev Log: Better clone method
Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java?rev=769603&r1=769602&r2=769603&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java (original) +++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/testelement/property/AbstractProperty.java Wed Apr 29 00:45:08 2009 @@ -100,13 +100,11 @@ */ public Object clone() { try { - AbstractProperty prop = (AbstractProperty) this.getClass().newInstance(); + AbstractProperty prop = (AbstractProperty) super.clone(); prop.name = name; prop.runningVersion = runningVersion; return prop; - } catch (InstantiationException e) { - throw new AssertionError(e); // clone should never return null - } catch (IllegalAccessException e) { + } catch (CloneNotSupportedException e) { throw new AssertionError(e); // clone should never return null } } --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-dev-unsubscr...@jakarta.apache.org For additional commands, e-mail: jmeter-dev-h...@jakarta.apache.org