You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2017/06/09 06:38:48 UTC

[lang] LANG-1334: Partically revert changes introduced in 7c19a1ff4c217f03c0be62baf1169d689f566825.

Repository: commons-lang
Updated Branches:
  refs/heads/master b48043d18 -> 18e692478


LANG-1334: Partically revert changes introduced in 7c19a1ff4c217f03c0be62baf1169d689f566825.

Replacing the static constants in CharEncoding with computed values can
cause compatibility issues, since compile time constants are inlined by
the compiler.


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/18e69247
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/18e69247
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/18e69247

Branch: refs/heads/master
Commit: 18e692478dcf91fdceb9b9fdca7c61a1111d63aa
Parents: b48043d
Author: Benedikt Ritter <br...@apache.org>
Authored: Fri Jun 9 08:37:11 2017 +0200
Committer: Benedikt Ritter <br...@apache.org>
Committed: Fri Jun 9 08:37:11 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/lang3/CharEncoding.java  | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/18e69247/src/main/java/org/apache/commons/lang3/CharEncoding.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/CharEncoding.java b/src/main/java/org/apache/commons/lang3/CharEncoding.java
index 634b3af..9f0d2e0 100644
--- a/src/main/java/org/apache/commons/lang3/CharEncoding.java
+++ b/src/main/java/org/apache/commons/lang3/CharEncoding.java
@@ -19,7 +19,6 @@ package org.apache.commons.lang3;
 
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.StandardCharsets;
 
 /**
  * <p>Character encoding names required of every implementation of the Java platform.</p>
@@ -33,7 +32,7 @@ import java.nio.charset.StandardCharsets;
  *
  * @see <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html">JRE character encoding names</a>
  * @since 2.1
- * @deprecated Java 7 introduced {@link StandardCharsets}, which defines these constants as
+ * @deprecated Java 7 introduced {@link java.nio.charset.StandardCharsets}, which defines these constants as
  * {@link Charset} objects. Use {@link Charset#name()} to get the string values provided in this class.
  * This class will be removed in a future release.
  */
@@ -45,7 +44,7 @@ public class CharEncoding {
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String ISO_8859_1 = StandardCharsets.ISO_8859_1.name();
+    public static final String ISO_8859_1 = "ISO-8859-1";
 
     /**
      * <p>Seven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block
@@ -53,7 +52,7 @@ public class CharEncoding {
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String US_ASCII = StandardCharsets.US_ASCII.name();
+    public static final String US_ASCII = "US-ASCII";
 
     /**
      * <p>Sixteen-bit Unicode Transformation Format, byte order specified by a mandatory initial
@@ -61,28 +60,28 @@ public class CharEncoding {
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String UTF_16 = StandardCharsets.UTF_16.name();
+    public static final String UTF_16 = "UTF-16";
 
     /**
      * <p>Sixteen-bit Unicode Transformation Format, big-endian byte order.</p>
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String UTF_16BE = StandardCharsets.UTF_16BE.name();
+    public static final String UTF_16BE = "UTF-16BE";
 
     /**
      * <p>Sixteen-bit Unicode Transformation Format, little-endian byte order.</p>
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String UTF_16LE = StandardCharsets.UTF_16LE.name();
+    public static final String UTF_16LE = "UTF-16LE";
 
     /**
      * <p>Eight-bit Unicode Transformation Format.</p>
      *
      * <p>Every implementation of the Java platform is required to support this character encoding.</p>
      */
-    public static final String UTF_8 = StandardCharsets.UTF_8.name();
+    public static final String UTF_8 = "UTF-8";
 
     /**
      * <p>Returns whether the named charset is supported.</p>