geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r149314 - geronimo/trunk/specs/activation/src/java/javax/activation/MailcapCommandMap.java
Date Mon, 31 Jan 2005 23:01:57 GMT
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) {



Mime
View raw message