Skip to content

Commit 6643637

Browse files
committed
[CODEC-178] Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1562097 13f79535-47bb-0310-9956-ffa450edef68
1 parent e615c87 commit 6643637

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The <action> type attribute can be add,update,fix,remove.
4343
</properties>
4444
<body>
4545
<release version="1.10" date="DD Mmmm 2014" description="Feature and fix release.">
46+
<action dev="ggregory" type="update" issue="CODEC-178">Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets</action>
4647
</release>
4748
<release version="1.9" date="20 December 2013" description="Feature and fix release.">
4849
<action dev="ggregory" type="update" issue="CODEC-174" due-to="Thomas Champagne">Improve performance of Beider Morse encoder</action>

src/main/java/org/apache/commons/codec/Charsets.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ public static Charset toCharset(final String charset) {
9393
* Every implementation of the Java platform is required to support this character encoding.
9494
*
9595
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
96+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
9697
*/
98+
@Deprecated
9799
public static final Charset ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1);
98100

99101
/**
@@ -102,7 +104,9 @@ public static Charset toCharset(final String charset) {
102104
* Every implementation of the Java platform is required to support this character encoding.
103105
*
104106
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
107+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
105108
*/
109+
@Deprecated
106110
public static final Charset US_ASCII = Charset.forName(CharEncoding.US_ASCII);
107111

108112
/**
@@ -112,7 +116,9 @@ public static Charset toCharset(final String charset) {
112116
* Every implementation of the Java platform is required to support this character encoding.
113117
*
114118
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
119+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
115120
*/
121+
@Deprecated
116122
public static final Charset UTF_16 = Charset.forName(CharEncoding.UTF_16);
117123

118124
/**
@@ -121,7 +127,9 @@ public static Charset toCharset(final String charset) {
121127
* Every implementation of the Java platform is required to support this character encoding.
122128
*
123129
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
130+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
124131
*/
132+
@Deprecated
125133
public static final Charset UTF_16BE = Charset.forName(CharEncoding.UTF_16BE);
126134

127135
/**
@@ -130,7 +138,9 @@ public static Charset toCharset(final String charset) {
130138
* Every implementation of the Java platform is required to support this character encoding.
131139
*
132140
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
141+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
133142
*/
143+
@Deprecated
134144
public static final Charset UTF_16LE = Charset.forName(CharEncoding.UTF_16LE);
135145

136146
/**
@@ -139,6 +149,8 @@ public static Charset toCharset(final String charset) {
139149
* Every implementation of the Java platform is required to support this character encoding.
140150
*
141151
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
152+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
142153
*/
154+
@Deprecated
143155
public static final Charset UTF_8 = Charset.forName(CharEncoding.UTF_8);
144156
}

0 commit comments

Comments
 (0)