commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject [44/50] [abbrv] commons-imaging git commit: Don't reassign method parameters
Date Wed, 24 May 2017 18:41:32 GMT
Don't reassign method parameters

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/imaging/trunk@1795459 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/commons-imaging/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-imaging/commit/5d89c428
Tree: http://git-wip-us.apache.org/repos/asf/commons-imaging/tree/5d89c428
Diff: http://git-wip-us.apache.org/repos/asf/commons-imaging/diff/5d89c428

Branch: refs/heads/master
Commit: 5d89c428925ab9e72032843c879bb30c0260bdba
Parents: 1804928
Author: Benedikt Ritter <britter@apache.org>
Authored: Wed May 17 21:27:03 2017 +0000
Committer: Benedikt Ritter <britter@apache.org>
Committed: Wed May 17 21:27:03 2017 +0000

----------------------------------------------------------------------
 src/main/java/org/apache/commons/imaging/Imaging.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-imaging/blob/5d89c428/src/main/java/org/apache/commons/imaging/Imaging.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/imaging/Imaging.java b/src/main/java/org/apache/commons/imaging/Imaging.java
index fc3a5d1..ec8a74d 100644
--- a/src/main/java/org/apache/commons/imaging/Imaging.java
+++ b/src/main/java/org/apache/commons/imaging/Imaging.java
@@ -162,19 +162,19 @@ public final class Imaging {
      * which may contain an image.
      * @return true if the filename has an image format file extension.
      */
-    public static boolean hasImageFileExtension(String filename) {
+    public static boolean hasImageFileExtension(final String filename) {
         if (filename == null) {
             return false;
         }
-        
-        filename = filename.toLowerCase(Locale.ENGLISH);
+
+        String normalizedFilename = filename.toLowerCase(Locale.ENGLISH);
 
         final ImageParser[] imageParsers = ImageParser.getAllImageParsers();
         for (final ImageParser imageParser : imageParsers) {
             final String[] exts = imageParser.getAcceptedExtensions();
 
             for (final String ext : exts) {
-                if (filename.endsWith(ext.toLowerCase(Locale.ENGLISH))) {
+                if (normalizedFilename.endsWith(ext.toLowerCase(Locale.ENGLISH))) {
                     return true;
                 }
             }


Mime
View raw message