Author: sebb
Date: Sun Feb 28 22:57:04 2016
New Revision: 1732815

URL: http://svn.apache.org/viewvc?rev=1732815&view=rev
Log:
Revert r1732634

Modified:
    
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
    
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java

Modified: 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java?rev=1732815&r1=1732814&r2=1732815&view=diff
==============================================================================
--- 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
 (original)
+++ 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
 Sun Feb 28 22:57:04 2016
@@ -30,6 +30,7 @@ import java.io.Serializable;
 import java.net.URL;
 import java.util.ArrayList;
 
+import org.apache.http.client.config.CookieSpecs;
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.engine.event.LoopIterationEvent;
 import org.apache.jmeter.testelement.TestIterationListener;
@@ -101,19 +102,12 @@ public class CookieManager extends Confi
 
     private transient CollectionProperty initialCookies;
 
-    // MUST NOT BE CHANGED because as defaults are not saved, 
-    // when a Test Plan was loaded from an N-1 version and if defaults changed,
-    // you end up changing the previously set policy
-    // see issues with Bug 58756
-    public static final String POLICY_FOR_BACKWARD_COMPATIBILITY = 
"compatibility";
+    // MUST NOT BE CHANGED
+    @SuppressWarnings("deprecation") // cannot be changed
+    public static final String DEFAULT_POLICY = 
CookieSpecs.BROWSER_COMPATIBILITY;
     
-    // MUST NOT BE CHANGED because as defaults are not saved, 
-    // when a Test Plan was loaded from an N-1 version and if defaults changed,
-    // you end up changing the previously set policy
-    // see issues with Bug 58756
-    public static final String IMPLEMENTATION_FOR_BACKWARD_COMPATIBILITY = 
HC3CookieHandler.class.getName();
-
-    public static final String DEFAULT_IMPLEMENTATION = 
HC4CookieHandler.class.getName();
+    // MUST NOT BE CHANGED
+    public static final String DEFAULT_IMPLEMENTATION = 
HC3CookieHandler.class.getName();
 
     public CookieManager() {
         clearCookies(); // Ensure that there is always a collection available
@@ -130,13 +124,11 @@ public class CookieManager extends Confi
     }
 
     public String getPolicy() {
-        return getPropertyAsString(POLICY, POLICY_FOR_BACKWARD_COMPATIBILITY);
+        return getPropertyAsString(POLICY, DEFAULT_POLICY);
     }
 
     public void setCookiePolicy(String policy){
-        // we must explicitely save the policy
-        // not use a default implementation
-        setProperty(POLICY, policy);
+        setProperty(POLICY, policy, DEFAULT_POLICY);
     }
 
     public CollectionProperty getCookies() {
@@ -156,13 +148,11 @@ public class CookieManager extends Confi
     }
 
     public String getImplementation() {
-        return getPropertyAsString(IMPLEMENTATION, 
IMPLEMENTATION_FOR_BACKWARD_COMPATIBILITY);
+        return getPropertyAsString(IMPLEMENTATION, DEFAULT_IMPLEMENTATION);
     }
 
     public void setImplementation(String implementation){
-        // we must explicitely save the policy
-        // not use a default implementation
-        setProperty(IMPLEMENTATION, implementation);
+        setProperty(IMPLEMENTATION, implementation, DEFAULT_IMPLEMENTATION);
     }
 
     /**

Modified: 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java?rev=1732815&r1=1732814&r2=1732815&view=diff
==============================================================================
--- 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
 (original)
+++ 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/CookiePanel.java
 Sun Feb 28 22:57:04 2016
@@ -280,9 +280,9 @@ public class CookiePanel extends Abstrac
 
         tableModel.clearData();
         clearEachIteration.setSelected(false);
+        policy.setText(HC4CookieHandler.DEFAULT_POLICY_NAME);
         selectHandlerPanel.setSelectedItem(DEFAULT_IMPLEMENTATION
                 .substring(DEFAULT_IMPLEMENTATION.lastIndexOf('.') + 1));
-        policy.setText(HC4CookieHandler.DEFAULT_POLICY_NAME);
         deleteButton.setEnabled(false);
         saveButton.setEnabled(false);
     }


Reply via email to