Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Java\apache-maven-3.0.4\bin\..
Java version: 1.6.0_35, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_35\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500) Maven home: C:\Java\apache-maven-3.0.4\bin\.. Java version: 1.6.0_35, vendor: Sun Microsystems Inc. Java home: C:\Program Files\Java\jdk1.6.0_35\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
A ContentType is immutable.
Before 4.2, you wrote code like this:
final Charset myCharset = ... final ContentType ct = ContentType.create(HTTP.OCTET_STREAM_TYPE, myCharset); {code:java} {{HTTP.OCTET_STREAM_TYPE}} is deprecated in 4.2. In order to avoid magic strings in the code I can do: {code:java} final ContentType ct = ContentType.create(ContentType.APPLICATION_OCTET_STREAM.getMimeType(), myCharset);
This issue allows the fluent style to be applied: