You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/04/03 09:06:37 UTC

Branch 1.1 and trunk now fully uses Java 5 Generics and covariant return types.

Hi community,

Today, I embarked myself in removing compiler warnings related to Java
5 Generics.  I reviewed the core API overally, fixed most warnings,
and applied Generics where possible.  This means that your life will
get easier when you deal with collections and classes.

Additionally, I used covariant return types where possible.  This also
means that your code will look more brief because you will need less
down-casting when accessing transport-specific properties (e.g.
setReuseAddress). For example:

----------------
SocketAcceptor acceptor = new SocketAcceptor();

// Before
((SocketAcceptorConfig) acceptor.getDefaultConfig()).setReuseAddress(true);
((SocketSessionConfig)
acceptor.getDefaultConfig().getSessionConfig()).setTcpNoDelay(true);

// After
acceptor.getDefaultConfig().setReuseAddress(true);
acceptor.getDefaultConfig().getSessionConfig().setTcpNoDelay(true);
----------------

Please try the latest snapshot of each branch, and let me know if
there's something I am missing.

1.1.0-SNAPSHOT:    http://tinyurl.com/2l8gy4
2.0.0-M1-SNAPSHOT: http://tinyurl.com/2sau2c

Cheers,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Branch 1.1 and trunk now fully uses Java 5 Generics and covariant return types.

Posted by Mark Webb <el...@gmail.com>.
I love seeing no errors or warnings in eclipse !!!


On 4/3/07, Trustin Lee <tr...@gmail.com> wrote:
>
> Hi community,
>
> Today, I embarked myself in removing compiler warnings related to Java
> 5 Generics.  I reviewed the core API overally, fixed most warnings,
> and applied Generics where possible.  This means that your life will
> get easier when you deal with collections and classes.
>
> Additionally, I used covariant return types where possible.  This also
> means that your code will look more brief because you will need less
> down-casting when accessing transport-specific properties (e.g.
> setReuseAddress). For example:
>
> ----------------
> SocketAcceptor acceptor = new SocketAcceptor();
>
> // Before
> ((SocketAcceptorConfig) acceptor.getDefaultConfig
> ()).setReuseAddress(true);
> ((SocketSessionConfig)
> acceptor.getDefaultConfig().getSessionConfig()).setTcpNoDelay(true);
>
> // After
> acceptor.getDefaultConfig().setReuseAddress(true);
> acceptor.getDefaultConfig().getSessionConfig().setTcpNoDelay(true);
> ----------------
>
> Please try the latest snapshot of each branch, and let me know if
> there's something I am missing.
>
> 1.1.0-SNAPSHOT:    http://tinyurl.com/2l8gy4
> 2.0.0-M1-SNAPSHOT: http://tinyurl.com/2sau2c
>
> Cheers,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>



-- 
..Cheers
Mark