geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r587072 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java
Date Mon, 22 Oct 2007 12:38:46 GMT
Author: rickmcguire
Date: Mon Oct 22 05:38:45 2007
New Revision: 587072

URL: http://svn.apache.org/viewvc?rev=587072&view=rev
Log:
GERONIMO-3539 Can not override providers using META-INF/javamail.providers file

Reorder the search for the provider config files to match what's in the spec. 


Modified:
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java?rev=587072&r1=587071&r2=587072&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java
Mon Oct 22 05:38:45 2007
@@ -553,19 +553,15 @@
         // will not overwrite entries if they already exist in the map.
 
         try {
-            Enumeration e = cl.getResources("META-INF/javamail.default.providers");
-            while (e.hasMoreElements()) {
-                URL url = (URL) e.nextElement();
+            File file = new File(System.getProperty("java.home"), "lib/javamail.providers");
+            InputStream is = new FileInputStream(file);
+            try {
+                loadProviders(info, is);
                 if (debug) {
-                    writeDebug("Loading javamail.default.providers from " + url.toString());
-                }
-
-                InputStream is = url.openStream();
-                try {
-                    loadProviders(info, is);
-                } finally{
-                    is.close();
+                    writeDebug("Loaded lib/javamail.providers from " + file.toString());
                 }
+            } finally{
+                is.close();
             }
         } catch (SecurityException e) {
             // ignore
@@ -573,17 +569,19 @@
             // ignore
         }
 
-
         try {
-            File file = new File(System.getProperty("java.home"), "lib/javamail.providers");
-            InputStream is = new FileInputStream(file);
-            try {
-                loadProviders(info, is);
+            Enumeration e = cl.getResources("META-INF/javamail.providers");
+            while (e.hasMoreElements()) {
+                URL url = (URL) e.nextElement();
                 if (debug) {
-                    writeDebug("Loaded lib/javamail.providers from " + file.toString());
+                    writeDebug("Loading META-INF/javamail.providers from " + url.toString());
+                }
+                InputStream is = url.openStream();
+                try {
+                    loadProviders(info, is);
+                } finally{
+                    is.close();
                 }
-            } finally{
-                is.close();
             }
         } catch (SecurityException e) {
             // ignore
@@ -592,12 +590,13 @@
         }
 
         try {
-            Enumeration e = cl.getResources("META-INF/javamail.providers");
+            Enumeration e = cl.getResources("META-INF/javamail.default.providers");
             while (e.hasMoreElements()) {
                 URL url = (URL) e.nextElement();
                 if (debug) {
-                    writeDebug("Loading META-INF/javamail.providers from " + url.toString());
+                    writeDebug("Loading javamail.default.providers from " + url.toString());
                 }
+
                 InputStream is = url.openStream();
                 try {
                     loadProviders(info, is);



Mime
View raw message