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() {
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

View File

@ -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