Fix a handful of warnings
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 9 Jan 2011 14:48:08 +0000 (14:48 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 9 Jan 2011 14:48:08 +0000 (14:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1056946 13f79535-47bb-0310-9956-ffa450edef68

java/javax/mail/Authenticator.java
java/org/apache/naming/factory/BeanFactory.java
java/org/apache/naming/factory/Constants.java
java/org/apache/naming/factory/EjbFactory.java
java/org/apache/naming/factory/MailSessionFactory.java
java/org/apache/naming/factory/OpenEjbFactory.java
java/org/apache/naming/factory/ResourceEnvFactory.java
java/org/apache/naming/factory/ResourceFactory.java
java/org/apache/naming/factory/ResourceLinkFactory.java
java/org/apache/naming/factory/SendMailFactory.java
java/org/apache/naming/factory/TransactionFactory.java

index c05c16c..78df841 100644 (file)
@@ -17,5 +17,7 @@
 package javax.mail;
 
 public class Authenticator {
-    // Dummy implementation
+    protected PasswordAuthentication getPasswordAuthentication() {
+        return null;
+    }
 }
index 30ce79a..b5bc69b 100644 (file)
@@ -107,6 +107,7 @@ public class BeanFactory
      * 
      * @param obj The reference object describing the Bean
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws NamingException {
@@ -169,7 +170,8 @@ public class BeanFactory
                                 valueArray[0] = value;
                             } else if (propType.equals(Character.class) 
                                        || propType.equals(char.class)) {
-                                valueArray[0] = new Character(value.charAt(0));
+                                valueArray[0] =
+                                    Character.valueOf(value.charAt(0));
                             } else if (propType.equals(Byte.class) 
                                        || propType.equals(byte.class)) {
                                 valueArray[0] = new Byte(value);
index 22ef7aa..a9fcf86 100644 (file)
@@ -54,8 +54,6 @@ public final class Constants {
     public static final String OPENEJB_EJB_FACTORY = 
         Package + ".OpenEjbFactory";
 
-    public static final String OBJECT_FACTORIES = "";
-
     public static final String FACTORY = "factory";
 
 }
index aec9497..5d37cd4 100644 (file)
@@ -61,6 +61,7 @@ public class EjbFactory
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws Exception {
index 8df4240..2b0ce55 100644 (file)
@@ -89,6 +89,7 @@ public class MailSessionFactory implements ObjectFactory {
      *
      * @exception Exception if an error occurs during object creation
      */
+    @Override
     public Object getObjectInstance(Object refObj, Name name, Context context,
             Hashtable<?,?> env) throws Exception {
 
@@ -103,6 +104,7 @@ public class MailSessionFactory implements ObjectFactory {
         //
         // Bugzilla 31288, 33077: add support for authentication.
         return AccessController.doPrivileged(new PrivilegedAction<Session>() {
+                @Override
                 public Session run() {
 
                     // Create the JavaMail properties we will use
@@ -137,6 +139,7 @@ public class MailSessionFactory implements ObjectFactory {
                         if(user != null) {
                             final PasswordAuthentication pa = new PasswordAuthentication(user, password);
                             auth = new Authenticator() {
+                                    @Override
                                     protected PasswordAuthentication getPasswordAuthentication() {
                                         return pa;
                                     }
index dc02894..5038d76 100644 (file)
@@ -55,6 +55,7 @@ public class OpenEjbFactory implements ObjectFactory {
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws Exception {
index 036c2ba..4067120 100644 (file)
@@ -60,6 +60,7 @@ public class ResourceEnvFactory
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws Exception {
index 1779175..ce14b1c 100644 (file)
@@ -60,6 +60,7 @@ public class ResourceFactory
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws Exception {
index 4e08899..76e3975 100644 (file)
@@ -74,6 +74,7 @@ public class ResourceLinkFactory
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws NamingException {
index 43554cb..63653bf 100644 (file)
@@ -26,7 +26,6 @@ import java.util.Properties;
 import javax.mail.Session;
 import javax.mail.internet.InternetAddress;
 import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimePart;
 import javax.mail.internet.MimePartDataSource;
 import javax.naming.Context;
 import javax.naming.Name;
@@ -80,6 +79,7 @@ public class SendMailFactory implements ObjectFactory
     protected final String DataSourceClassName = 
         "javax.mail.internet.MimePartDataSource";
 
+    @Override
     public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx,
             Hashtable<?,?> Env) throws Exception {
         final Reference Ref = (Reference)RefObj;
@@ -91,6 +91,7 @@ public class SendMailFactory implements ObjectFactory
             return AccessController.doPrivileged(
                     new PrivilegedAction<MimePartDataSource>()
             {
+                @Override
                 public MimePartDataSource run() {
                     // set up the smtp session that will send the message
                     Properties props = new Properties();
@@ -114,8 +115,7 @@ public class SendMailFactory implements ObjectFactory
                         message.setFrom(new InternetAddress(from));
                         message.setSubject("");
                     } catch (Exception e) {}
-                    MimePartDataSource mds = new MimePartDataSource(
-                        (MimePart)message);
+                    MimePartDataSource mds = new MimePartDataSource(message);
                     return mds;
                 }
             } );
index 95b80ae..00f9a28 100644 (file)
@@ -60,6 +60,7 @@ public class TransactionFactory
      * 
      * @param obj The reference object describing the DataSource
      */
+    @Override
     public Object getObjectInstance(Object obj, Name name, Context nameCtx,
                                     Hashtable<?,?> environment)
         throws Exception {