Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  ChangeArgumentParser: Avoid NPE when project is not given
  Change wording about the example plugin in dev-plugins.txt
  Remove references to cookbook plugin from dev-eclipse.txt

Change-Id: I1cb6691b64fffcd6d389ad77ebf6b310d32d2f0b
This commit is contained in:
David Pursehouse
2019-04-26 16:59:28 +09:00
2 changed files with 7 additions and 9 deletions

View File

@@ -33,12 +33,9 @@ Most of this documentation refers to either type as a plugin.
[[getting-started]]
== Getting started
To get started with the development of a plugin clone the sample
plugins:
----
$ git clone https://gerrit.googlesource.com/plugins/examples
----
To get started with the development of a plugin, take a look at
the samples in the
link:https://gerrit.googlesource.com/plugins/examples[examples plugin project].
This is a project that demonstrates the various features of the
plugin API. It can be taken as an example to develop an own plugin.

View File

@@ -14,6 +14,7 @@
package com.google.gerrit.sshd;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.extensions.restapi.RestApiException;
import com.google.gerrit.reviewdb.client.Change;
@@ -59,7 +60,7 @@ public class ChangeArgumentParser {
}
public void addChange(
String id, Map<Change.Id, ChangeResource> changes, ProjectState projectState)
String id, Map<Change.Id, ChangeResource> changes, @Nullable ProjectState projectState)
throws UnloggedFailure, PermissionBackendException, IOException {
addChange(id, changes, projectState, true);
}
@@ -67,7 +68,7 @@ public class ChangeArgumentParser {
public void addChange(
String id,
Map<Change.Id, ChangeResource> changes,
ProjectState projectState,
@Nullable ProjectState projectState,
boolean useIndex)
throws UnloggedFailure, PermissionBackendException, IOException {
List<ChangeNotes> matched = useIndex ? changeFinder.find(id) : changeFromNotesFactory(id);
@@ -87,7 +88,7 @@ public class ChangeArgumentParser {
continue;
}
if (!projectState.statePermitsRead()) {
if (projectState != null && !projectState.statePermitsRead()) {
continue;
}