geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r510527 - in /geronimo/specs/trunk: ./ geronimo-javamail_1.3.1_spec/ geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/ geronimo-javamail_1.4_spec/src/main/java/javax/mail/
Date Thu, 22 Feb 2007 14:17:49 GMT
Author: rickmcguire
Date: Thu Feb 22 06:17:48 2007
New Revision: 510527

URL: http://svn.apache.org/viewvc?view=rev&rev=510527
Log:
GERONIMO-2867 javax.mail.Service.connect() not using port from transport URLName()


Added:
    geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/
      - copied from r510078, geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.2/
Modified:
    geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/pom.xml
    geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Service.java
    geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Session.java
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java
    geronimo/specs/trunk/pom.xml

Modified: geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/pom.xml?view=diff&rev=510527&r1=510078&r2=510527
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/pom.xml Thu Feb 22 06:17:48 2007
@@ -46,8 +46,8 @@
 
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.2</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.2</developerConnection>
-    <url>https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.2</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.3</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.3</developerConnection>
+    <url>https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-javamail_1.3.1_spec-1.3</url>
   </scm>
 </project>

Modified: geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Service.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Service.java?view=diff&rev=510527&r1=510078&r2=510527
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Service.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Service.java
Thu Feb 22 06:17:48 2007
@@ -118,6 +118,13 @@
         if (url != null) {
             protocol = url.getProtocol();
         }
+        
+        // if the port is -1, see if we have an override from url. 
+        if (port == -1) {
+            if (protocol != null) {
+                port = url.getPort();
+            }
+        }
 
         // now try to derive values for any of the arguments we've been given as defaults
         if (host == null) {
@@ -127,7 +134,9 @@
                 // it is possible that this could return null (rare).  If it does, try to
get a
                 // value from a protocol specific session variable.
                 if (host == null) {
-                    host = session.getProperty("mail." + protocol + ".host");
+                	if (protocol != null) {
+                        host = session.getProperty("mail." + protocol + ".host");
+                    }
                 }
             }
             // this may still be null...get the global mail property
@@ -147,7 +156,9 @@
                 }
                 // user still null?  We have several levels of properties to try yet
                 if (user == null) {
-                    user = session.getProperty("mail." + protocol + ".user");
+                	if (protocol != null) {
+                        user = session.getProperty("mail." + protocol + ".user");
+                    }
                 }
             }
 
@@ -217,6 +228,7 @@
             connected = protocolConnect(host, port, user, password);
         }
         catch (AuthenticationFailedException e) {
+            e.printStackTrace(); 
         }
 
         if (!connected) {
@@ -236,7 +248,6 @@
                 user = promptPassword.getUserName();
                 password = promptPassword.getPassword();
             }
-
             connected = protocolConnect(host, port, user, password);
         }
 

Modified: geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Session.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Session.java?view=diff&rev=510527&r1=510078&r2=510527
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Session.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.3.1_spec/src/main/java/javax/mail/Session.java
Thu Feb 22 06:17:48 2007
@@ -441,6 +441,9 @@
 
     private Service getService(Provider provider, URLName name) throws NoSuchProviderException
{
         try {
+            if (name == null) {
+                name = new URLName(provider.getProtocol(), null, -1, null, null, null); 
+            }
             ClassLoader cl = getClassLoader();
             Class clazz = cl.loadClass(provider.getClassName());
             Constructor ctr = clazz.getConstructor(PARAM_TYPES);

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java?view=diff&rev=510527&r1=510526&r2=510527
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java
Thu Feb 22 06:17:48 2007
@@ -132,6 +132,13 @@
         if (url != null) {
             protocol = url.getProtocol();
         }
+        
+        // if the port is -1, see if we have an override from url. 
+        if (port == -1) {
+            if (protocol != null) {
+                port = url.getPort();
+            }
+        }
 
         // now try to derive values for any of the arguments we've been given as defaults
         if (host == null) {

Modified: geronimo/specs/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/pom.xml?view=diff&rev=510527&r1=510526&r2=510527
==============================================================================
--- geronimo/specs/trunk/pom.xml (original)
+++ geronimo/specs/trunk/pom.xml Thu Feb 22 06:17:48 2007
@@ -103,6 +103,7 @@
     <modules>
         <module>geronimo-activation_1.1_spec</module>
         <module>geronimo-commonj_1.1_spec</module>
+        <module>geronimo-javamail_1.3.1_spec</module>
         <module>geronimo-javamail_1.4_spec</module>
         <module>geronimo-servlet_2.5_spec</module>
     </modules>



Mime
View raw message