changeset 15997:c505e725b85b

8168498: ExifGPSTagSet and ExifTIFFTagSet should use string literals for String constants Summary: Change new String(byte[],CharSet) to a string literal. Reviewed-by: prr
author bpb
date Mon, 24 Oct 2016 13:19:05 -0700
parents aae3690e53e3
children 96153792172a
files src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java
diffstat 2 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java	Thu Oct 20 14:21:46 2016 +0300
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifGPSTagSet.java	Mon Oct 24 13:19:05 2016 -0700
@@ -55,9 +55,7 @@
      *
      * @see #TAG_GPS_VERSION_ID
      */
-    public static final String GPS_VERSION_2_2 =
-        new String(new byte[] { '2', '2', '0', '0' },
-        StandardCharsets.US_ASCII);
+    public static final String GPS_VERSION_2_2 = "2200";
 
     /**
      * A tag indicating the North or South latitude (type ASCII, count = 2).
--- a/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java	Thu Oct 20 14:21:46 2016 +0300
+++ b/src/java.desktop/share/classes/javax/imageio/plugins/tiff/ExifTIFFTagSet.java	Mon Oct 24 13:19:05 2016 -0700
@@ -71,9 +71,7 @@
      *
      * @see #TAG_EXIF_VERSION
      */
-    public static final String EXIF_VERSION_2_1 =
-        new String(new byte[] { '0', '2', '1', '0' },
-        StandardCharsets.US_ASCII);
+    public static final String EXIF_VERSION_2_1 = "0210";
 
     /**
      * A value to be used with the "ExifVersion" tag to indicate Exif version
@@ -82,9 +80,7 @@
      *
      * @see #TAG_EXIF_VERSION
      */
-    public static final String EXIF_VERSION_2_2 =
-        new String(new byte[] { '0', '2', '2', '0' },
-        StandardCharsets.US_ASCII);
+    public static final String EXIF_VERSION_2_2 = "0220";
 
     /**
      * A tag indicating the FlashPix version number (type UNDEFINED,