提交 389ee4b8 编写于 作者: M mduigou

7041612: Rename StandardCharset to StandardCharsets

Reviewed-by: alanb, mr, darcy
上级 b077dcb3
...@@ -71,7 +71,7 @@ FILES_src = \ ...@@ -71,7 +71,7 @@ FILES_src = \
java/nio/charset/CoderMalfunctionError.java \ java/nio/charset/CoderMalfunctionError.java \
java/nio/charset/CodingErrorAction.java \ java/nio/charset/CodingErrorAction.java \
java/nio/charset/MalformedInputException.java \ java/nio/charset/MalformedInputException.java \
java/nio/charset/StandardCharset.java \ java/nio/charset/StandardCharsets.java \
java/nio/charset/UnmappableCharacterException.java \ java/nio/charset/UnmappableCharacterException.java \
\ \
java/nio/charset/spi/CharsetProvider.java \ java/nio/charset/spi/CharsetProvider.java \
......
...@@ -215,7 +215,7 @@ import sun.security.action.GetPropertyAction; ...@@ -215,7 +215,7 @@ import sun.security.action.GetPropertyAction;
* determined during virtual-machine startup and typically depends upon the * determined during virtual-machine startup and typically depends upon the
* locale and charset being used by the underlying operating system. </p> * locale and charset being used by the underlying operating system. </p>
* *
* <p>The {@link StandardCharset} class defines constants for each of the * <p>The {@link StandardCharsets} class defines constants for each of the
* standard charsets. * standard charsets.
* *
* <h4>Terminology</h4> * <h4>Terminology</h4>
......
...@@ -32,10 +32,10 @@ package java.nio.charset; ...@@ -32,10 +32,10 @@ package java.nio.charset;
* @see <a href="Charset#standard">Standard Charsets</a> * @see <a href="Charset#standard">Standard Charsets</a>
* @since 1.7 * @since 1.7
*/ */
public final class StandardCharset { public final class StandardCharsets {
private StandardCharset() { private StandardCharsets() {
throw new AssertionError("No java.nio.charset.StandardCharset instances for you!"); throw new AssertionError("No java.nio.charset.StandardCharsets instances for you!");
} }
/** /**
* Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the * Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the
......
...@@ -72,7 +72,7 @@ import java.util.Iterator; ...@@ -72,7 +72,7 @@ import java.util.Iterator;
* directory and is UTF-8 encoded. * directory and is UTF-8 encoded.
* <pre> * <pre>
* Path path = FileSystems.getDefault().getPath("logs", "access.log"); * Path path = FileSystems.getDefault().getPath("logs", "access.log");
* BufferReader reader = Files.newBufferedReader(path, StandardCharset.UTF_8); * BufferReader reader = Files.newBufferedReader(path, StandardCharsets.UTF_8);
* </pre> * </pre>
* *
* <a name="interop"><h4>Interoperability</h4></a> * <a name="interop"><h4>Interoperability</h4></a>
......
...@@ -28,7 +28,7 @@ package java.util.zip; ...@@ -28,7 +28,7 @@ package java.util.zip;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.CharBuffer; import java.nio.CharBuffer;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharset; import java.nio.charset.StandardCharsets;
import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder; import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult; import java.nio.charset.CoderResult;
...@@ -107,7 +107,7 @@ final class ZipCoder { ...@@ -107,7 +107,7 @@ final class ZipCoder {
if (isUTF8) if (isUTF8)
return getBytes(s); return getBytes(s);
if (utf8 == null) if (utf8 == null)
utf8 = new ZipCoder(StandardCharset.UTF_8); utf8 = new ZipCoder(StandardCharsets.UTF_8);
return utf8.getBytes(s); return utf8.getBytes(s);
} }
...@@ -116,7 +116,7 @@ final class ZipCoder { ...@@ -116,7 +116,7 @@ final class ZipCoder {
if (isUTF8) if (isUTF8)
return toString(ba, len); return toString(ba, len);
if (utf8 == null) if (utf8 == null)
utf8 = new ZipCoder(StandardCharset.UTF_8); utf8 = new ZipCoder(StandardCharsets.UTF_8);
return utf8.toString(ba, len); return utf8.toString(ba, len);
} }
...@@ -132,7 +132,7 @@ final class ZipCoder { ...@@ -132,7 +132,7 @@ final class ZipCoder {
private ZipCoder(Charset cs) { private ZipCoder(Charset cs) {
this.cs = cs; this.cs = cs;
this.isUTF8 = cs.name().equals(StandardCharset.UTF_8.name()); this.isUTF8 = cs.name().equals(StandardCharsets.UTF_8.name());
} }
static ZipCoder get(Charset charset) { static ZipCoder get(Charset charset) {
......
...@@ -31,7 +31,7 @@ import java.io.IOException; ...@@ -31,7 +31,7 @@ import java.io.IOException;
import java.io.EOFException; import java.io.EOFException;
import java.io.File; import java.io.File;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharset; import java.nio.charset.StandardCharsets;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.Deque; import java.util.Deque;
import java.util.Enumeration; import java.util.Enumeration;
...@@ -141,7 +141,7 @@ class ZipFile implements ZipConstants, Closeable { ...@@ -141,7 +141,7 @@ class ZipFile implements ZipConstants, Closeable {
* @since 1.3 * @since 1.3
*/ */
public ZipFile(File file, int mode) throws IOException { public ZipFile(File file, int mode) throws IOException {
this(file, mode, StandardCharset.UTF_8); this(file, mode, StandardCharsets.UTF_8);
} }
/** /**
......
...@@ -30,7 +30,7 @@ import java.io.IOException; ...@@ -30,7 +30,7 @@ import java.io.IOException;
import java.io.EOFException; import java.io.EOFException;
import java.io.PushbackInputStream; import java.io.PushbackInputStream;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharset; import java.nio.charset.StandardCharsets;
import static java.util.zip.ZipConstants64.*; import static java.util.zip.ZipConstants64.*;
/** /**
...@@ -76,7 +76,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { ...@@ -76,7 +76,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* @param in the actual input stream * @param in the actual input stream
*/ */
public ZipInputStream(InputStream in) { public ZipInputStream(InputStream in) {
this(in, StandardCharset.UTF_8); this(in, StandardCharsets.UTF_8);
} }
/** /**
......
...@@ -28,7 +28,7 @@ package java.util.zip; ...@@ -28,7 +28,7 @@ package java.util.zip;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharset; import java.nio.charset.StandardCharsets;
import java.util.Vector; import java.util.Vector;
import java.util.HashSet; import java.util.HashSet;
import static java.util.zip.ZipConstants64.*; import static java.util.zip.ZipConstants64.*;
...@@ -101,7 +101,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants { ...@@ -101,7 +101,7 @@ class ZipOutputStream extends DeflaterOutputStream implements ZipConstants {
* @param out the actual output stream * @param out the actual output stream
*/ */
public ZipOutputStream(OutputStream out) { public ZipOutputStream(OutputStream out) {
this(out, StandardCharset.UTF_8); this(out, StandardCharsets.UTF_8);
} }
/** /**
......
...@@ -26,7 +26,7 @@ package sun.awt; ...@@ -26,7 +26,7 @@ package sun.awt;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder; import java.nio.charset.CharsetEncoder;
import java.nio.charset.StandardCharset; import java.nio.charset.StandardCharsets;
import sun.nio.cs.HistoricallyNamedCharset; import sun.nio.cs.HistoricallyNamedCharset;
public class FontDescriptor implements Cloneable { public class FontDescriptor implements Cloneable {
...@@ -105,8 +105,8 @@ public class FontDescriptor implements Cloneable { ...@@ -105,8 +105,8 @@ public class FontDescriptor implements Cloneable {
if (useUnicode && unicodeEncoder == null) { if (useUnicode && unicodeEncoder == null) {
try { try {
this.unicodeEncoder = isLE? this.unicodeEncoder = isLE?
StandardCharset.UTF_16LE.newEncoder(): StandardCharsets.UTF_16LE.newEncoder():
StandardCharset.UTF_16BE.newEncoder(); StandardCharsets.UTF_16BE.newEncoder();
} catch (IllegalArgumentException x) {} } catch (IllegalArgumentException x) {}
} }
return useUnicode; return useUnicode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册