commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-codec] branch release updated: [CODEC-277] Don't reload standard Charsets in org.apache.commons.codec.Charsets.
Date Mon, 30 Dec 2019 14:25:46 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/commons-codec.git


The following commit(s) were added to refs/heads/release by this push:
     new ae0da81  [CODEC-277] Don't reload standard Charsets in org.apache.commons.codec.Charsets.
ae0da81 is described below

commit ae0da813d949a850a5937e73b7f57a673a712040
Author: Gary Gregory <garydgregory@gmail.com>
AuthorDate: Mon Dec 30 09:25:43 2019 -0500

    [CODEC-277] Don't reload standard Charsets in
    org.apache.commons.codec.Charsets.
---
 src/changes/changes.xml                              |  3 ++-
 src/main/java/org/apache/commons/codec/Charsets.java | 13 +++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 9e1c3c4..223aa1e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,7 +55,8 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="CODEC-273" dev="ggregory" type="add" due-to="Gary Gregory">Add
Path APIs to org.apache.commons.codec.digest.DigestUtils similar to File APIs.</action>
       <action issue="CODEC-274" dev="ggregory" type="add" due-to="Gary Gregory">Add
SHA-512/224 and SHA-512/256 to DigestUtils for Java 9 and up.</action>
       <action issue="CODEC-275" dev="ggregory" type="add" due-to="Claude Warren">Add
missing note in javadoc when sign extension error is present #34.</action>
-      <action issue="CODEC-276" dev="ggregory" type="add" due-to="Gary Gregory">Reliance
on default encoding in MurmurHash2 and MurmurHash3.</action>
+      <action issue="CODEC-276" dev="ggregory" type="fix" due-to="Gary Gregory">Reliance
on default encoding in MurmurHash2 and MurmurHash3.</action>
+      <action issue="CODEC-277" dev="ggregory" type="update" due-to="Gary Gregory">Don't
reload standard Charsets in org.apache.commons.codec.Charsets.</action>
     </release>
 
     <release version="1.13" date="2019-07-20" description="Feature and fix release.">
diff --git a/src/main/java/org/apache/commons/codec/Charsets.java b/src/main/java/org/apache/commons/codec/Charsets.java
index aad811a..7a34f1d 100644
--- a/src/main/java/org/apache/commons/codec/Charsets.java
+++ b/src/main/java/org/apache/commons/codec/Charsets.java
@@ -17,6 +17,7 @@
 package org.apache.commons.codec;
 
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 
 /**
  * Charsets required of every implementation of the Java platform.
@@ -97,7 +98,7 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset ISO_8859_1 = Charset.forName(CharEncoding.ISO_8859_1);
+    public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;
 
     /**
      * Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the
Unicode character set.
@@ -110,7 +111,7 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset US_ASCII = Charset.forName(CharEncoding.US_ASCII);
+    public static final Charset US_ASCII = StandardCharsets.US_ASCII;
 
     /**
      * Sixteen-bit Unicode Transformation Format, The byte order specified by a mandatory
initial byte-order mark
@@ -124,7 +125,7 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset UTF_16 = Charset.forName(CharEncoding.UTF_16);
+    public static final Charset UTF_16 = StandardCharsets.UTF_16;
 
     /**
      * Sixteen-bit Unicode Transformation Format, big-endian byte order.
@@ -137,7 +138,7 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset UTF_16BE = Charset.forName(CharEncoding.UTF_16BE);
+    public static final Charset UTF_16BE = StandardCharsets.UTF_16BE;
 
     /**
      * Sixteen-bit Unicode Transformation Format, little-endian byte order.
@@ -150,7 +151,7 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset UTF_16LE = Charset.forName(CharEncoding.UTF_16LE);
+    public static final Charset UTF_16LE = StandardCharsets.UTF_16LE;
 
     /**
      * Eight-bit Unicode Transformation Format.
@@ -163,5 +164,5 @@ public class Charsets {
      *
      * @see <a href="http://docs.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">Standard
charsets</a>
      */
-    public static final Charset UTF_8 = Charset.forName(CharEncoding.UTF_8);
+    public static final Charset UTF_8 = StandardCharsets.UTF_8;
 }


Mime
View raw message