Title: [2264] branches/v-1.4.x: Fix: WeakCache.entrySet().iterator().next.setValue(value) returns the reference instead of the old value.
Revision
2264
Author
joehni
Date
2014-02-11 12:16:56 -0600 (Tue, 11 Feb 2014)

Log Message

Fix: WeakCache.entrySet().iterator().next.setValue(value) returns the reference instead of the old value.

Modified Paths

Diff

Modified: branches/v-1.4.x/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java (2263 => 2264)


--- branches/v-1.4.x/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java	2014-02-10 23:57:21 UTC (rev 2263)
+++ branches/v-1.4.x/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java	2014-02-11 18:16:56 UTC (rev 2264)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2013 XStream Committers.
+ * Copyright (C) 2011, 2013, 2014 XStream Committers.
  * All rights reserved.
  *
  * The software in this package is published under the terms of the BSD
@@ -135,7 +135,8 @@
                         }
 
                         public Object setValue(Object value) {
-                            return entry.setValue(createReference(value));
+                            Reference reference = (Reference)entry.setValue(createReference(value));
+                            return reference != null ? reference.get() : null;
                         }
 
                     });

Modified: branches/v-1.4.x/xstream-distribution/src/content/changes.html (2263 => 2264)


--- branches/v-1.4.x/xstream-distribution/src/content/changes.html	2014-02-10 23:57:21 UTC (rev 2263)
+++ branches/v-1.4.x/xstream-distribution/src/content/changes.html	2014-02-11 18:16:56 UTC (rev 2264)
@@ -36,6 +36,7 @@
     
     <ul>
     	<li>Fix: DateConverter ignores provided locale.</li>
+    	<li>Fix: WeakCache.entrySet().iterator().next.setValue(value) returns the reference instead of the old value.</li>
     </ul>
 
     <h2>API changes</h2>

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to