Simplify redundant 'if' statements.

This commit is contained in:
Craig P. Motlin 2011-11-12 13:23:40 -05:00
parent f0520dad20
commit ab61090572
2 changed files with 4 additions and 16 deletions

View File

@ -225,15 +225,10 @@ public final class LocalTimeProtocol {
private void initFields() { private void initFields() {
continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA; continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA;
} }
@Override @Override
public boolean isInitialized() { public boolean isInitialized() {
if (!hasContinent) { return hasContinent && hasCity;
return false;
}
if (!hasCity) {
return false;
}
return true;
} }
@Override @Override
@ -1000,10 +995,7 @@ public final class LocalTimeProtocol {
if (!hasMinute) { if (!hasMinute) {
return false; return false;
} }
if (!hasSecond) { return hasSecond;
return false;
}
return true;
} }
@Override @Override

View File

@ -288,11 +288,7 @@ public class DefaultCookie implements Cookie {
} else if (that.getDomain() == null) { } else if (that.getDomain() == null) {
return false; return false;
} }
if (!getDomain().equalsIgnoreCase(that.getDomain())) { return getDomain().equalsIgnoreCase(that.getDomain());
return false;
}
return true;
} }
@Override @Override