Skip to content

Commit fd63ffd

Browse files
committed
[IO-422] 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/io/trunk@1562881 13f79535-47bb-0310-9956-ffa450edef68
1 parent 8730123 commit fd63ffd

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ The <action> type attribute can be add,update,fix,remove.
4646

4747
<body>
4848
<!-- The release date is the date RC is cut -->
49-
<release version="2.5" date="2014-??-??" description="New features and bug fixes.">
49+
<release version="2.5" date="2014-??-??" description="New features and bug fixes.">
50+
<action issue="IO-422" dev="ggregory" type="update">
51+
Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets
52+
</action>
5053
<action issue="IO-410" dev="sebb" type="add" due-to="BELUGA BEHR">
5154
Readfully() That Returns A Byte Array
5255
</action>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class Charsets {
7373
*/
7474
public static SortedMap<String, Charset> requiredCharsets() {
7575
// maybe cache?
76+
// TODO Re-implement on Java 7 to use java.nio.charset.StandardCharsets
7677
final TreeMap<String, Charset> m = new TreeMap<String, Charset>(String.CASE_INSENSITIVE_ORDER);
7778
m.put(ISO_8859_1.name(), ISO_8859_1);
7879
m.put(US_ASCII.name(), US_ASCII);
@@ -114,7 +115,9 @@ public static Charset toCharset(final String charset) {
114115
* </p>
115116
*
116117
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
118+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
117119
*/
120+
@Deprecated
118121
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
119122

120123
/**
@@ -126,7 +129,9 @@ public static Charset toCharset(final String charset) {
126129
* </p>
127130
*
128131
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
132+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
129133
*/
134+
@Deprecated
130135
public static final Charset US_ASCII = Charset.forName("US-ASCII");
131136

132137
/**
@@ -139,7 +144,9 @@ public static Charset toCharset(final String charset) {
139144
* </p>
140145
*
141146
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
147+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
142148
*/
149+
@Deprecated
143150
public static final Charset UTF_16 = Charset.forName("UTF-16");
144151

145152
/**
@@ -151,7 +158,9 @@ public static Charset toCharset(final String charset) {
151158
* </p>
152159
*
153160
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
161+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
154162
*/
163+
@Deprecated
155164
public static final Charset UTF_16BE = Charset.forName("UTF-16BE");
156165

157166
/**
@@ -163,7 +172,9 @@ public static Charset toCharset(final String charset) {
163172
* </p>
164173
*
165174
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
175+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
166176
*/
177+
@Deprecated
167178
public static final Charset UTF_16LE = Charset.forName("UTF-16LE");
168179

169180
/**
@@ -175,6 +186,8 @@ public static Charset toCharset(final String charset) {
175186
* </p>
176187
*
177188
* @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard charsets</a>
189+
* @deprecated Use Java 7's {@link java.nio.charset.StandardCharsets}
178190
*/
191+
@Deprecated
179192
public static final Charset UTF_8 = Charset.forName("UTF-8");
180193
}

0 commit comments

Comments
 (0)