You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/09/19 22:31:10 UTC
svn commit: r697227 -
/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java
Author: sebb
Date: Fri Sep 19 13:31:10 2008
New Revision: 697227
URL: http://svn.apache.org/viewvc?rev=697227&view=rev
Log:
No need for clone() method in functions
Synchronised all access to globalCounter
Modified:
jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java
Modified: jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java?rev=697227&r1=697226&r2=697227&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java (original)
+++ jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/IterationCounter.java Fri Sep 19 13:31:10 2008
@@ -31,7 +31,7 @@
public class IterationCounter extends AbstractFunction implements Serializable {
- private static final long serialVersionUID = 232L;
+ private static final long serialVersionUID = 233L;
private static final List desc = new LinkedList();
@@ -39,8 +39,15 @@
private transient ThreadLocal perThreadInt;
+ private transient Object[] variables;
+
+ private transient int globalCounter;//MAXINT = 2,147,483,647
+
private void init(){
- perThreadInt = new ThreadLocal(){
+ synchronized(this){
+ globalCounter=0;
+ }
+ perThreadInt = new ThreadLocal(){
protected synchronized Object initialValue() {
return new Integer(0);
}
@@ -52,25 +59,15 @@
desc.add(JMeterUtils.getResString("function_name_paropt")); //$NON-NLS-1$
}
- private transient Object[] variables;
-
- private transient int globalCounter;//MAXINT = 2,147,483,647
-
public IterationCounter() {
init();
- globalCounter=0;
}
private Object readResolve(){
init();
- globalCounter=0;
return this;
}
- public Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
-
/*
* (non-Javadoc)
*
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org