Patch Review: source/javax/mail/FetchProfile.java

"Conrad T. Pino" <[email protected]> Wed, 28 Nov 2007 17:51:35 -0800
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <[email protected]>
Patch goal:

1. Remove field FetchProfile.Item.name is never read locally
   warnings, 57 in total.

Java 5 has @SuppressWarnings annotation but only if source level
is so set requiring make system to detect compiler version & act
accordingly.  Probably fails with older compilers.

The following patch adds a protected method to return the field
and is noted as a non JavaMail API function.

Another alternative is override "toString()" to "return name;"
but that's not in JavaMail API either.

Index: source/javax/mail/FetchProfile.java
===================================================================
RCS file: /sources/classpathx/mail/source/javax/mail/FetchProfile.java,v
retrieving revision 1.13
diff -u -r1.13 FetchProfile.java
--- source/javax/mail/FetchProfile.java	27 Nov 2007 22:03:56 -0000	1.13
+++ source/javax/mail/FetchProfile.java	28 Nov 2007 22:58:16 -0000
@@ -71,6 +71,14 @@
       this.name = name;
     }
 
+    /**
+     * The method is not a JavaMail API method.
+     */
+    protected String getName()
+    {
+      return name;
+    }
+
   }