geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r597092 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/Service.java
Date Wed, 21 Nov 2007 14:02:39 GMT
Author: rickmcguire
Date: Wed Nov 21 06:02:38 2007
New Revision: 597092

URL: http://svn.apache.org/viewvc?rev=597092&view=rev
Log:
GERONIMO-3622 javamail Service class still exposing user password in some situations.


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

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?rev=597092&r1=597091&r2=597092&view=diff
==============================================================================
--- 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
Wed Nov 21 06:02:38 2007
@@ -50,6 +50,9 @@
     // the EventQueue spins off a new thread, so we only create this 
     // if we have actual listeners to dispatch an event to. 
     private EventQueue queue = null;
+    // when returning the URL, we need to ensure that the password and file information is

+    // stripped out. 
+    private URLName exposedUrl; 
 
     /**
      * Construct a new Service.
@@ -356,8 +359,14 @@
      * @return the URLName for this service
      */
     public URLName getURLName() {
-
-        return url == null ? null : new URLName(url.getProtocol(), url.getHost(), url.getPort(),
null, url.getUsername(), null);
+        // if we haven't composed the URL version we hand out, create it now.  But only if
we really 
+        // have a URL. 
+        if (exposedUrl == null) {
+            if (url != null) {
+                exposedUrl = new URLName(url.getProtocol(), url.getHost(), url.getPort(),
null, url.getUsername(), null);
+            }
+        }
+        return exposedUrl; 
     }
 
     /**



Mime
View raw message