commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1538030 - /commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java
Date Fri, 01 Nov 2013 18:50:16 GMT
Author: ggregory
Date: Fri Nov  1 18:50:15 2013
New Revision: 1538030

URL: http://svn.apache.org/r1538030
Log:
Statement unnecessarily nested within else clause.

Modified:
    commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java

Modified: commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java?rev=1538030&r1=1538029&r2=1538030&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java
(original)
+++ commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/tiff/taginfos/TagInfoGpsText.java
Fri Nov  1 18:50:15 2013
@@ -100,23 +100,22 @@ public final class TagInfoGpsText extend
                 System.arraycopy(asciiBytes, 0, result,
                         TEXT_ENCODING_ASCII.prefix.length, asciiBytes.length);
                 return result;
+            }
+            // use unicode
+            final TextEncoding encoding;
+            if (byteOrder == ByteOrder.BIG_ENDIAN) {
+                encoding = TEXT_ENCODING_UNICODE_BE;
             } else {
-                // use unicode
-                final TextEncoding encoding;
-                if (byteOrder == ByteOrder.BIG_ENDIAN) {
-                    encoding = TEXT_ENCODING_UNICODE_BE;
-                } else {
-                    encoding = TEXT_ENCODING_UNICODE_LE;
-                }
-                final byte unicodeBytes[] = s.getBytes(encoding.encodingName);
-                final byte result[] = new byte[unicodeBytes.length +
-                                               encoding.prefix.length];
-                System.arraycopy(encoding.prefix, 0,
-                        result, 0, encoding.prefix.length);
-                System.arraycopy(unicodeBytes, 0,
-                        result, encoding.prefix.length, unicodeBytes.length);
-                return result;
+                encoding = TEXT_ENCODING_UNICODE_LE;
             }
+            final byte unicodeBytes[] = s.getBytes(encoding.encodingName);
+            final byte result[] = new byte[unicodeBytes.length +
+                                           encoding.prefix.length];
+            System.arraycopy(encoding.prefix, 0,
+                    result, 0, encoding.prefix.length);
+            System.arraycopy(unicodeBytes, 0,
+                    result, encoding.prefix.length, unicodeBytes.length);
+            return result;
         } catch (final UnsupportedEncodingException e) {
             throw new ImageWriteException(e.getMessage(), e);
         }



Mime
View raw message