Author: norman
Date: Mon Nov 21 10:33:44 2011
New Revision: 1204438

URL: http://svn.apache.org/viewvc?rev=1204438&view=rev
Log:
Remove usage of @deprecated methods and suppress some warnings

Modified:
    
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java?rev=1204438&r1=1204437&r2=1204438&view=diff
==============================================================================
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/BasicChannelUpstreamHandler.java
 Mon Nov 21 10:33:44 2011
@@ -81,13 +81,13 @@ public class BasicChannelUpstreamHandler
     /**
      * Call the {@link ConnectHandler} instances which are stored in the 
{@link ProtocolHandlerChain}
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent 
e) throws Exception {
         List<ConnectHandler> connectHandlers = 
chain.getHandlers(ConnectHandler.class);
         List<ProtocolHandlerResultHandler> resultHandlers = 
chain.getHandlers(ProtocolHandlerResultHandler.class);
         ProtocolSession session = (ProtocolSession) ctx.getAttachment();
-        session.getLogger().info("Connection established from " + 
session.getRemoteIPAddress());
+        session.getLogger().info("Connection established from " + 
session.getRemoteAddress().getAddress().getHostAddress());
         if (connectHandlers != null) {
             for (int i = 0; i < connectHandlers.size(); i++) {
                 ConnectHandler cHandler = connectHandlers.get(i);
@@ -116,7 +116,8 @@ public class BasicChannelUpstreamHandler
 
 
 
-    @Override
+    @SuppressWarnings({ "rawtypes", "unchecked" })
+       @Override
     public void channelDisconnected(ChannelHandlerContext ctx, 
ChannelStateEvent e) throws Exception {
         List<DisconnectHandler> connectHandlers = 
chain.getHandlers(DisconnectHandler.class);
         ProtocolSession session = (ProtocolSession) ctx.getAttachment();
@@ -132,7 +133,7 @@ public class BasicChannelUpstreamHandler
     /**
      * Call the {@link LineHandler} 
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) 
throws Exception {
         ProtocolSession pSession = (ProtocolSession) ctx.getAttachment();
@@ -181,7 +182,7 @@ public class BasicChannelUpstreamHandler
     public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) 
throws Exception {
         ProtocolSession session = (ProtocolSession) ctx.getAttachment();
         if (session != null) {
-            session.getLogger().info("Connection closed for " + 
session.getRemoteIPAddress());
+            session.getLogger().info("Connection closed for " + 
session.getRemoteAddress().getAddress().getHostAddress());
         }
         cleanup(ctx);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to