Author: rdonkin
Date: Sat Sep 5 08:16:29 2009
New Revision: 811602
URL: http://svn.apache.org/viewvc?rev=811602&view=rev
Log:
Resolve warnings and optimise imports. No semantics changes.
Modified:
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
Modified:
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java?rev=811602&r1=811601&r2=811602&view=diff
==============================================================================
---
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
(original)
+++
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
Sat Sep 5 08:16:29 2009
@@ -21,7 +21,12 @@
package org.apache.james.smtpserver;
-import org.apache.avalon.framework.activity.Initializable;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -34,12 +39,6 @@
import org.apache.james.smtpserver.core.CoreCmdHandlerLoader;
import org.apache.james.smtpserver.core.CoreMessageHookLoader;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-
/**
* The SMTPHandlerChain is per service object providing access
* ConnectHandlers, Commandhandlers and message handlers
@@ -66,11 +65,12 @@
for (Iterator<?> h = handlers.iterator(); h.hasNext(); ) {
Object handler = h.next();
if (handler instanceof ExtensibleHandler) {
- List markerInterfaces = ((ExtensibleHandler)
handler).getMarkerInterfaces();
+ final ExtensibleHandler extensibleHandler =
(ExtensibleHandler) handler;
+ final List<Class<?>> markerInterfaces =
extensibleHandler.getMarkerInterfaces();
for (int i= 0;i < markerInterfaces.size(); i++) {
- Class markerInterface = (Class) markerInterfaces.get(i);
- List extensions = getHandlers(markerInterface);
- ((ExtensibleHandler)
handler).wireExtensions(markerInterface,extensions);
+ final Class<?> markerInterface = markerInterfaces.get(i);
+ final List<?> extensions = getHandlers(markerInterface);
+
extensibleHandler.wireExtensions(markerInterface,extensions);
}
}
}
@@ -248,6 +248,7 @@
* @param type the type of handler we're interested in
* @return a List of handlers
*/
+ @SuppressWarnings("unchecked")
public <T> LinkedList<T> getHandlers(Class<T> type) {
LinkedList<T> result = new LinkedList<T>();
for (Iterator<?> i = handlers.iterator(); i.hasNext(); ) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]