opensubscriber
   Find in this group all groups
 
Unknown more information…

c : classpathx-javamail@gnu.org 28 November 2007 • 4:10PM -0500

[Classpathx-javamail] Patch Review: source/javax/mail/Provider.java
by Conrad T. Pino

REPLY TO AUTHOR
 
REPLY TO GROUP



Patch goals:

1. Conform to API, add missing method: Provider.Type.toString
http://java.sun.com/products/javamail/javadocs/javax/mail/Provider.Type.html

2. Reduce compile warnings for Provider.Type.type field.

Index: source/javax/mail/Provider.java
===================================================================
RCS file: /sources/classpathx/mail/source/javax/mail/Provider.java,v
retrieving revision 1.11
diff -u -r1.11 Provider.java
--- source/javax/mail/Provider.java 27 Nov 2007 22:03:57 -0000 1.11
+++ source/javax/mail/Provider.java 28 Nov 2007 07:30:10 -0000
@@ -43,8 +43,8 @@
   public static class Type
   {

-    public static final Type STORE = new Type("Store");
-    public static final Type TRANSPORT = new Type("Transport");
+    public static final Type STORE = new Type("STORE");
+    public static final Type TRANSPORT = new Type("TRANSPORT");

     private String type;

@@ -53,6 +53,11 @@
       this.type = type;
     }

+    public String toString()
+    {
+      return type;
+    }
+
   }

   private Type type;
@@ -124,13 +129,10 @@
   {
     StringBuffer buffer = new StringBuffer();
     buffer.append("javax.mail.Provider[");
-    if (type == Type.STORE)
+    if (type != null)
       {
-        buffer.append("STORE,");
-      }
-    else if (type == Type.TRANSPORT)
-      {
-        buffer.append("TRANSPORT,");
+        buffer.append(type);
+        buffer.append(',');
       }
     buffer.append(protocol);
     buffer.append(',');


_______________________________________________
Classpathx-javamail mailing list
Classpathx-javamail@gnu....
http://lists.gnu.org/mailman/listinfo/classpathx-javamail

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.