Simplify conditions with && and ||

Change-Id: I77fb945cdf6b18baec064d1ac4b6002ef02e437a
This commit is contained in:
alex.ryazantsev
2013-11-18 00:50:00 +04:00
parent fc798093b8
commit 84001777ed
4 changed files with 4 additions and 4 deletions

View File

@@ -312,7 +312,7 @@ public class ProjectAccessScreen extends ProjectScreen {
private void enable(boolean enabled) {
commitMessage.setEnabled(enabled);
commit.setEnabled(enabled ? !access.getOwnerOf().isEmpty() : false);
commit.setEnabled(enabled && !access.getOwnerOf().isEmpty());
review.setEnabled(enabled ? access.canUpload() : false);
cancel1.setEnabled(enabled);
cancel2.setEnabled(enabled);

View File

@@ -190,6 +190,6 @@ public class Section {
if (a == null && b == null) {
return true;
}
return a != null ? a.equals(b) : false;
return a != null && a.equals(b);
}
}

View File

@@ -210,6 +210,6 @@ public class ProjectWatch {
p = Predicate.and(filterPredicate, p);
}
}
return p == null ? true : p.match(changeData);
return p == null || p.match(changeData);
}
}

View File

@@ -112,7 +112,7 @@ abstract class RefPatternMatcher {
RefPatternMatcher next =
getMatcher(template.replace(Collections.singletonMap("username", u)));
return next != null ? next.match(ref, username) : false;
return next != null && next.match(ref, username);
}
boolean matchPrefix(String ref) {