dev@grizzly.java.net

another your opinion ?

From: charlie hunt <charlie.hunt_at_sun.com>
Date: Mon, 30 Apr 2007 09:07:42 -0500

There's another Jackpot transformation called "if statements that can be
simplified".

What it is finding in the grizzly framework source is structures that
look like;

    public boolean isOpen(){
        if (selector != null){
            return selector.isOpen();
        } else {
            return false;
        }
    }

And, it suggests to transform them into:

    public boolean isOpen(){
        if (selector != null){
            return selector.isOpen();
        }
        return false;
    }

I'd like to hear others opinions on this "simplification". I don't know
as if I find the transformation any simpler.

In fact if I were to transform the initial implementation I would do
something like:

    public boolean isOpen(){
        boolean result = false;
        if (selector != null){
            result = selector.isOpen();
        }
        return result;
    }

charlie ...

-- 
Charlie Hunt
Java Performance Engineer
630.285.7708 x47708 (Internal)
<http://java.sun.com/docs/performance/>