Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  ChangeIdHandler: Make assumption on number of query results explicit
  ChangeIdHandler: Remove unnecessary 'final' modifiers
  Update git submodules
  AbstractQueryChangesTest: Add method to create change as private
  AbstractQueryChangesTest: Fix comment in byPrivate
  AbstractQueryChangesTest: Use overloaded newChange method where possible
  AbstractQueryChangesTest: Extend testing of visibleto predicate
  ChangeQueryBuilder: Rename status_open to statusOpen
  ChangeQueryBuilder: Rename is_visible to isVisible
  Extract duplicated code of {Ssh|Http}LogJsonLayout
  Add option to log SSH events in JSON format
  Remove duplicated constants storing key names of Ssh logs
  Add option to log HTTP logging events in JSON format

Change-Id: Ib4de5b560a75ea85ca15581d73dde24baf83c1b4
This commit is contained in:
Marco Miller
2020-02-20 13:20:40 -05:00
15 changed files with 387 additions and 69 deletions

View File

@@ -488,7 +488,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData, ChangeQueryBuil
return ChangeStatusPredicate.parse(statusName);
}
public Predicate<ChangeData> status_open() {
public Predicate<ChangeData> statusOpen() {
return ChangeStatusPredicate.open();
}
@@ -537,7 +537,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData, ChangeQueryBuil
}
if ("visible".equalsIgnoreCase(value)) {
return is_visible();
return isVisible();
}
if ("reviewed".equalsIgnoreCase(value)) {
@@ -955,7 +955,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData, ChangeQueryBuil
public Predicate<ChangeData> visibleto(String who)
throws QueryParseException, IOException, ConfigInvalidException {
if (isSelf(who)) {
return is_visible();
return isVisible();
}
try {
return Predicate.or(
@@ -990,7 +990,7 @@ public class ChangeQueryBuilder extends QueryBuilder<ChangeData, ChangeQueryBuil
args.anonymousUserProvider);
}
public Predicate<ChangeData> is_visible() throws QueryParseException {
public Predicate<ChangeData> isVisible() throws QueryParseException {
return visibleto(args.getUser());
}

View File

@@ -77,13 +77,13 @@ public class IsWatchedByPredicate extends AndPredicate<ChangeData> {
} else if (f != null) {
r.add(f);
} else {
r.add(builder.status_open());
r.add(builder.statusOpen());
}
}
if (r.isEmpty()) {
return ImmutableList.of(ChangeIndexPredicate.none());
} else if (checkIsVisible) {
return ImmutableList.of(or(r), builder.is_visible());
return ImmutableList.of(or(r), builder.isVisible());
} else {
return ImmutableList.of(or(r));
}