Esempio n. 1
0
  private List<List<ChangeInfo>> query() throws OrmException, QueryParseException {
    if (imp.isDisabled()) {
      throw new QueryParseException("query disabled");
    }
    if (queries == null || queries.isEmpty()) {
      queries = Collections.singletonList("status:open");
    } else if (queries.size() > 10) {
      // Hard-code a default maximum number of queries to prevent
      // users from submitting too much to the server in a single call.
      throw new QueryParseException("limit of 10 queries");
    }

    IdentifiedUser self = null;
    try {
      if (user.get().isIdentifiedUser()) {
        self = (IdentifiedUser) user.get();
        self.asyncStarredChanges();
      }
      return query0();
    } finally {
      if (self != null) {
        self.abortStarredChanges();
      }
    }
  }
Esempio n. 2
0
 public void clearStarredChanges() {
   // Async query may have started before an update that the caller expects
   // to see the results of, so we can't trust it.
   abortStarredChanges();
   starredChanges = null;
 }