Merge "Remove unneeded null checks"

This commit is contained in:
Shawn Pearce
2013-08-22 15:56:08 +00:00
committed by Gerrit Code Review
4 changed files with 6 additions and 8 deletions

View File

@@ -280,7 +280,7 @@ public class PermissionEditor extends Composite implements Editor<Permission>,
validRange = null;
}
if (value != null && Permission.OWNER.equals(value.getName())) {
if (Permission.OWNER.equals(value.getName())) {
exclusiveGroup.setEnabled(false);
} else {
exclusiveGroup.setEnabled(!readOnly);

View File

@@ -120,7 +120,7 @@ public class ProjectAccessEditor extends Composite implements
history.getStyle().setDisplay(Display.NONE);
}
addSection.setVisible(value != null && editing && (!value.getOwnerOf().isEmpty() || value.canUpload()));
addSection.setVisible(editing && (!value.getOwnerOf().isEmpty() || value.canUpload()));
}
@Override

View File

@@ -339,13 +339,11 @@ public class ChangeScreen extends Screen
patchesList.addItem(Util.C.baseDiffItem());
}
for (PatchSet pId : detail.getPatchSets()) {
if (patchesList != null) {
patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId
.getId().toString());
}
patchesList.addItem(Util.M.patchSetHeader(pId.getPatchSetId()), pId
.getId().toString());
}
if (diffBaseId != null && patchesList != null) {
if (diffBaseId != null) {
patchesList.setSelectedIndex(diffBaseId.get());
}

View File

@@ -418,7 +418,7 @@ public class ChangeUtil {
final GitReferenceUpdated gitRefUpdated, final ReviewDb db)
throws NoSuchChangeException, OrmException, IOException {
final PatchSet.Id patchSetId = patch.getId();
if (patch == null || !patch.isDraft()) {
if (!patch.isDraft()) {
throw new NoSuchChangeException(patchSetId.getParentKey());
}