You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2005/02/01 00:01:57 UTC

svn commit: r149314 - geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java

Author: jboynes
Date: Mon Jan 31 15:01:56 2005
New Revision: 149314

URL: http://svn.apache.org/viewcvs?view=rev&rev=149314
Log:
clean up code a little

Modified:
    geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java

Modified: geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java?view=diff&r1=149313&r2=149314
==============================================================================
--- geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java (original)
+++ geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java Mon Jan 31 15:01:56 2005
@@ -279,19 +279,19 @@
 
         // search for an exact match
         Map commands = (Map) preferredCommands.get(mimeType.toLowerCase());
-        if(commands != null) {
-            return (CommandInfo) commands.get(cmdName.toLowerCase());
+        if (commands == null) {
+            i = mimeType.indexOf('/');
+            if (i == -1) {
+                mimeType = mimeType + "/*";
+            } else {
+                mimeType = mimeType.substring(0, i + 1) + "*";
+            }
+            commands = (Map) preferredCommands.get(mimeType.toLowerCase());
         }
-        i = mimeType.indexOf('/');
-        if (i == -1) {
-            mimeType = mimeType + "/*";
-        } else {
-            mimeType = mimeType.substring(0, i + 1) + "*";
+        if (commands == null) {
+            return null;
         }
-        commands = (Map) preferredCommands.get(mimeType.toLowerCase());
-        if(commands != null)
-            return (CommandInfo) commands.get(cmdName.toLowerCase());
-        return null;
+        return (CommandInfo) commands.get(cmdName.toLowerCase());
     }
 
     public synchronized DataContentHandler createDataContentHandler(String mimeType) {