Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Consume JGit artifacts from Maven Central
  Consume JGit artifacts from Maven Central
  gr-related-changes: Don't show "Same topic" for only one change
  RelatedChanges: Don't show "Same Topic" for only one change
  ChangeEditApi: Allow to set options on change edit detail request
  Add Javadoc to clarify behavior of {Accounts|Changes|Groups}#withOptions
  OnlineNoteDbMigrationIT: improve readability of some tests
  Update git submodules
  Add release notes for Gerrit v2.10.8
  Add release notes for Gerrit v2.9.5
  Set version to 2.13.12
  Set version to 2.12.9
  Set version to 2.11.12
  Set version to 2.10.8
  Set version to 2.9.5

Change-Id: Id02a8afc6e4e8d42b759ed2ea28a0926411ff2e8
This commit is contained in:
David Pursehouse
2019-01-18 21:47:17 +09:00
15 changed files with 285 additions and 75 deletions

View File

@@ -14,11 +14,13 @@
package com.google.gerrit.extensions.api.changes;
import com.google.gerrit.extensions.client.ChangeEditDetailOption;
import com.google.gerrit.extensions.common.EditInfo;
import com.google.gerrit.extensions.restapi.BinaryResult;
import com.google.gerrit.extensions.restapi.NotImplementedException;
import com.google.gerrit.extensions.restapi.RawInput;
import com.google.gerrit.extensions.restapi.RestApiException;
import java.util.EnumSet;
import java.util.Optional;
/**
@@ -29,6 +31,33 @@ import java.util.Optional;
*/
public interface ChangeEditApi {
abstract class ChangeEditDetailRequest {
private String base;
private EnumSet<ChangeEditDetailOption> options = EnumSet.noneOf(ChangeEditDetailOption.class);
public abstract Optional<EditInfo> get() throws RestApiException;
public ChangeEditDetailRequest withBase(String base) {
this.base = base;
return this;
}
public ChangeEditDetailRequest withOption(ChangeEditDetailOption option) {
this.options.add(option);
return this;
}
public String getBase() {
return base;
}
public EnumSet<ChangeEditDetailOption> options() {
return options;
}
}
ChangeEditDetailRequest detail() throws RestApiException;
/**
* Retrieves details regarding the change edit.
*
@@ -155,6 +184,11 @@ public interface ChangeEditApi {
* interface.
*/
class NotImplemented implements ChangeEditApi {
@Override
public ChangeEditDetailRequest detail() throws RestApiException {
throw new NotImplementedException();
}
@Override
public Optional<EditInfo> get() throws RestApiException {
throw new NotImplementedException();