Author: sebb
Date: Tue Mar 28 13:58:58 2017
New Revision: 1789142
URL: http://svn.apache.org/viewvc?rev=1789142&view=rev
Log:
CODEC-232 URLCodec is neither immutable nor threadsafe
Modified:
commons/proper/codec/trunk/src/changes/changes.xml
commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
Modified: commons/proper/codec/trunk/src/changes/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1789142&r1=1789141&r2=1789142&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/changes/changes.xml (original)
+++ commons/proper/codec/trunk/src/changes/changes.xml Tue Mar 28 13:58:58 2017
@@ -45,6 +45,7 @@ The <action> type attribute can be add,u
<release version="1.11" date="2017-MM-DD" description="Feature and fix
release.">
<!-- The first attribute below should be the issue id; makes it easier
to navigate in the IDE outline -->
+ <action issue="CODEC-232" dev="sebb" type="fix">URLCodec is neither
immutable nor threadsafe</action>
<action issue="CODEC-231" dev="sebb"
type="fix">StringUtils.equals(CharSequence cs1, CharSequence cs2) can fail with
String Index OBE</action>
<action issue="CODEC-230" dev="sebb" type="fix">URLCodec.WWW_FORM_URL
should be private</action>
<action issue="CODEC-229" dev="sebb"
type="fix">StringUtils.newStringxxx(null) should return null, not NPE</action>
Modified:
commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
URL:
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java?rev=1789142&r1=1789141&r2=1789142&view=diff
==============================================================================
---
commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
(original)
+++
commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/net/URLCodec.java
Tue Mar 28 13:58:58 2017
@@ -37,7 +37,7 @@ import org.apache.commons.codec.binary.S
* {@link java.net.URLDecoder} on older Java platforms, as these classes in
Java versions below
* 1.4 rely on the platform's default charset encoding.
* <p>
- * This class is immutable and thread-safe.
+ * This class is thread-safe since 1.11
*
* @see <a
href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">Chapter
17.13.4 Form content types</a>
* of the <a href="http://www.w3.org/TR/html4/">HTML 4.01
Specification</a>
@@ -53,7 +53,7 @@ public class URLCodec implements BinaryE
* @deprecated TODO: This field will be changed to a private final Charset
in 2.0. (CODEC-126)
*/
@Deprecated
- protected String charset;
+ protected volatile String charset; // added volatile: see CODEC-232
/**
* Release 1.5 made this field final.
@@ -62,7 +62,9 @@ public class URLCodec implements BinaryE
/**
* BitSet of www-form-url safe characters.
- * @deprecated Will be removed in 2.0 (CODEC-230)
+ * This is a copy of the internal BitSet which is now used for the
conversion.
+ * Changes to this field are ignored.
+ * @deprecated 1.11 Will be removed in 2.0 (CODEC-230)
*/
@Deprecated
protected static final BitSet WWW_FORM_URL;