diff --git a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java index 7946fef1a8..8628f34d64 100644 --- a/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java +++ b/src/main/java/org/jboss/netty/example/localtime/LocalTimeProtocol.java @@ -225,15 +225,10 @@ public final class LocalTimeProtocol { private void initFields() { continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; } + @Override public boolean isInitialized() { - if (!hasContinent) { - return false; - } - if (!hasCity) { - return false; - } - return true; + return hasContinent && hasCity; } @Override @@ -1000,10 +995,7 @@ public final class LocalTimeProtocol { if (!hasMinute) { return false; } - if (!hasSecond) { - return false; - } - return true; + return hasSecond; } @Override diff --git a/src/main/java/org/jboss/netty/handler/codec/http/DefaultCookie.java b/src/main/java/org/jboss/netty/handler/codec/http/DefaultCookie.java index 90fdf70dfa..d938b21069 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/DefaultCookie.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/DefaultCookie.java @@ -288,11 +288,7 @@ public class DefaultCookie implements Cookie { } else if (that.getDomain() == null) { return false; } - if (!getDomain().equalsIgnoreCase(that.getDomain())) { - return false; - } - - return true; + return getDomain().equalsIgnoreCase(that.getDomain()); } @Override