classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] Patch Review: source/javax/mail/Provider.java


From: Conrad T. Pino
Subject: [Classpathx-javamail] Patch Review: source/javax/mail/Provider.java
Date: Wed, 28 Nov 2007 00:10:27 -0800

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(',');




reply via email to

[Prev in Thread] Current Thread [Next in Thread]