geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r702537 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Session.java
Date Tue, 07 Oct 2008 16:39:34 GMT
Author: rickmcguire
Date: Tue Oct  7 09:39:34 2008
New Revision: 702537

URL: http://svn.apache.org/viewvc?rev=702537&view=rev
Log:
GERONIMO-4341 javax.mail.NoSuchProviderException: Unable to locate provider for protocol:
pop3


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=702537&r1=702536&r2=702537&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
Tue Oct  7 09:39:34 2008
@@ -497,11 +497,13 @@
 
     private ProviderInfo getProviderInfo() {
         ClassLoader cl = getClassLoader();
-        ProviderInfo info = (ProviderInfo) providersByClassLoader.get(cl);
-        if (info == null) {
-            info = loadProviders(cl);
+        synchronized (providersByClassLoader) {
+            ProviderInfo info = (ProviderInfo) providersByClassLoader.get(cl);
+            if (info == null) {
+                info = loadProviders(cl);
+            }
+            return info;
         }
-        return info;
     }
 
     private Map getAddressMap() {
@@ -545,10 +547,6 @@
         //
         ProviderInfo info = new ProviderInfo();
 
-        // make sure this is added to the global map.
-        providersByClassLoader.put(cl, info);
-
-
         // NOTE:  Unlike the addressMap, we process these in the defined order.  The loading
routine
         // will not overwrite entries if they already exist in the map.
 
@@ -609,6 +607,9 @@
         } catch (IOException e) {
             // ignore
         }
+        
+        // make sure this is added to the global map.
+        providersByClassLoader.put(cl, info); 
 
         return info;
     }



Mime
View raw message