jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1442366 - in /jmeter/trunk/src: components/org/apache/jmeter/control/ThroughputController.java core/org/apache/jmeter/control/GenericController.java core/org/apache/jmeter/control/TransactionController.java
Date Mon, 04 Feb 2013 21:18:14 GMT
Author: pmouawad
Date: Mon Feb  4 21:18:14 2013
New Revision: 1442366

URL: http://svn.apache.org/viewvc?rev=1442366&view=rev
Log:
Bug 52265 - Code:Transient fields not set by deserialization
Bugzilla Id: 52265

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java?rev=1442366&r1=1442365&r2=1442366&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java Mon Feb
 4 21:18:14 2013
@@ -77,10 +77,8 @@ public class ThroughputController extend
     private transient MutableInteger globalNumExecutions;
 
     private transient MutableInteger globalIteration;
-    // FIXME Sync on byte is wrong, stupid of me
-    private Byte counterLock = new Byte("0"); // ensure counts are updated correctly
-    // Need to use something that is serializable, so Object is no use
-    // TODO does it need to be serializable? If not, we can use transient Object
+
+    private transient Object counterLock = new Object(); // ensure counts are updated correctly
 
     /**
      * Number of iterations on which we've chosen to deliver samplers.
@@ -274,5 +272,12 @@ public class ThroughputController extend
     public void testEnded(String host) {
     	// NOOP
     }
+    
+    @Override
+    protected Object readResolve(){
+        super.readResolve();
+        counterLock = new Object();
+        return this;
+    }
 
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java?rev=1442366&r1=1442365&r2=1442366&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/GenericController.java Mon Feb  4 21:18:14
2013
@@ -58,7 +58,7 @@ public class GenericController extends A
         new LinkedList<LoopIterationListener>();
 
     // Only create the map if it is required
-    private transient final ConcurrentMap<TestElement, Object> children = 
+    private transient ConcurrentMap<TestElement, Object> children = 
             TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement,
Object>();
 
     private static final Object DUMMY = new Object();
@@ -429,4 +429,16 @@ public class GenericController extends A
     protected void resetIterCount() {
         iterCount = 0;
     }
+    
+    protected Object readResolve(){
+        iterationListeners =
+                new LinkedList<LoopIterationListener>();
+        children = 
+                TestCompiler.IS_USE_STATIC_SET ? null : new ConcurrentHashMap<TestElement,
Object>();
+        
+        subControllersAndSamplers =
+                new ArrayList<TestElement>();
+
+        return this;
+    }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java?rev=1442366&r1=1442365&r2=1442366&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java Mon Feb  4
21:18:14 2013
@@ -97,7 +97,9 @@ public class TransactionController exten
         lnf = new ListenerNotifier();
     }
 
-    private Object readResolve(){
+    @Override
+    protected Object readResolve(){
+        super.readResolve();
         lnf = new ListenerNotifier();
         return this;
     }



Mime
View raw message