rest-api-groups.txt: Correct input examples to use [] for lists

Change-Id: I109bced2f9309dd20a7962d5fdbcd999fa6f87ff
(cherry picked from commit a2bf824fa154b7cb51e8f89df8321d02c25f3425)
Fix REST example for removing included groups from a group

Change-Id: I8047fa702c12150232ebf62bcd16a27eb638c5e8
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Fix: Wrong exception mapping in ReceiveCommmits

When IOException is thrown in insertPatchSet() or
insertChange(), e.g. ClosedByInterruptException thrown
from AutoCommitWriter.manualFlush(), it will be
mapped to OrmException with error message
"Error updating database" by ORM_EXCEPTION, this becomes
misleading when the administrator analyzes the error log.

Fixed. Replaced the ORM_EXCEPTION with INSERT_EXCEPTION.

Change-Id: I49a6dfea7e49df72db775989a3a0501f60db76d2
Bump SSHD version to 0.10.1 and enable nio2 backend

46f8488a78742799a4f5f781279c8955460e7964 removed nio2 backend because of
a bug [1].  Given that the bug is fixed and released, enable it again.

Another problem was also fixed and released [2].

Upgrade to the official version 0.10.1 makes Gerrit's own custom patch of
SSHD and hosting it on Google bucket unnecessary.

[1] https://issues.apache.org/jira/browse/SSHD-252
[2] https://issues.apache.org/jira/browse/SSHD-255

Bug: Issue 2406
Change-Id: I6668f6194427f153e1982e14b3936d2f3132fa7d
Update sshd to 0.11.0

Fixes a few issues including a null pointer exception [1] that causes
ssh commands to hang.

It also adds server driven rekeying after 1G bytes of data transferred,
which is a useful security feature.

[1] https://issues.apache.org/jira/browse/SSHD-307

Change-Id: I441995eaf76e4fe53f7991f5aef00e062900791b
Fix: wrongly throw 'commit already exists' exception

The reason is the ReplaceRequest.validate() should compare
to 'newCommit' of ReplaceRequest instance, else when
ReceiveCommits.autoCloseChanges() working on the second one
of a series of commits, the 'commit already exists(in the project)'
will be thrown wrongly.

Fixed.

Bug: issue 2607
Change-Id: Ib4db351d39f85d57ccf532da4d6422bdcbb88105
Remove "Click to" from topic edit button's tooltip

Making it more consistent with the tooltips on the other
buttons.

Change-Id: I3f26b08866452eb666da2a23be7201528b5f81a7
Merge changes I441995ea,I6668f619 into stable-2.8

* changes:
  Update sshd to 0.11.0
  Bump SSHD version to 0.10.1 and enable nio2 backend
SideBySide2: Fix failure to load from "ISE EditIterator out of bounds"

Intraline edit information can include a negative delta on the B
side of an edit, for example:

  {
    a: [...],
    b: [...],
    edit_a: [[4, 11], [14, 12]]
    edit_b: [[4, 66], [37, 41], [-2, 1]]
  }

In the edit_a or edit_b block the list pairs are the number of
characters to advance since the last position. -2 encodes the edit
iterator has to go back 2 positions to return the correct value.

This situation arose from an intraline edit list of:

  REPLACE( 4-15,  4- 70),
  REPLACE(29-41,107-148),
  INSERT (62-62,146-147)

The EditList is sorted by the beginA values, where 29 < 62. This
forced the final INSERT to sort in the edit_b list after the REPLACE
at 107. Since 146 < 148 the final edit_b entry was encoded with a
negative delta (148 - 146 = -2).

Update the UI code to accept a negative delta in the iterator. There
are already many /diff responses with negative delta that will be
cached by browsers for 7 days.

There may be other issues with the intraline diff algorithm that
allows it to create this final INSERT span within the REPLACE
span, but the code is essentially unchanged for many years in
Gerrit Code Review. Handle the corner case for now in the UI while
the server code is investigated further.

Change-Id: Ibec0fc845356af7c02f25acac23c4e709f7c3a34
Added global request handlers to SshDaemon

Since sshd 0.10.0 the handling of global requests
is refactored out of [1] ServerConnectionService.globalRequest
method to AbstractConnectionService.globalRequest.
The implementation has been refactored into a list
of RequestHandlers, one for each type of request.

These handlers are never set in SshDaemon constructor
as they should be.

See SshServer.getUpDefaultServer line 503

Change-Id: I7a38145c021538838d11427950db66eb57a50582
Bump bouncycastle verison to 1.49

Many bugs were fixed since version 1.44 that we are using[1].

JARs artifacts were renamed.

[1] http://www.bouncycastle.org/releasenotes.html

Change-Id: Ie2b22328c77b0100dfff61139b737894b88e7664
Install open ssl jar into Gerrit site for bouncycastle crypto provider

937d527ac0e4ee685fccb60ae604406a6638daec upgraded bouncy castle to 1.49.

The old JAR artifact was renamed and split to number of files. For Gerrit
two libraries must be downloaded and be available under `$gerrit_site/lib`:

* bcprov-jdk15on-149.jar
* bcpkix-jdk15on-149.jar

Update download logic to support a basic concept of required dependencies,
ensuring BC provider is downloaded if the SSL library is installed by init.

Change-Id: I60092ebe136f78a5649fe8512737275f50195a34
Fix log spew caused by DeleteBranch constructor

Every time branches are accessed the server logs a nasty Guice
trace preventing DeleteBranch from being created. The view must
create without enforcing the IdentifiedUser to exist. The solution
throughout the rest of Gerrit REST API code is to use Provider<X>
instead of X to allow Guice to defer this resolution.

Change-Id: If7fd7f4c38bcbc685d4f9451479da7a9ed432564
ChangeScreen2: Only reset the commit message text on cancel

Allow the user to begin editing the commit message, dismiss the
box by clicking outside of it (e.g. to copy part of a file name
from the Files table), and then re-open the current draft text
without resetting the box.

Only reset the box when the user explicitly clicks Cancel. Track
this by using the empty string in the text editor to mean there
is no valid message and the current original should be used.

Change-Id: Icd99b92c50ff92e0b1dc31a78fc57612f57a143b
Split PGPEncryptedDataGenerator creation out into a utility method

Split the creation of PGPEncryptedDataGenerator out into a utility
method.  Inline the call to the open() method on the returned generator
rather than storing the generator in a temporary variable.

Suppress deprecation warnings caused by using methods that have been
deprecated in the new version of Bouncycastle that was introduced
recently.  We cannot yet replace the calls with the newer versions
because some Gerrit sites still use the older version of Bouncycastle.

Change-Id: I98f4b7c7bf8ab1ee74eb8bbc86b673d057d98e46
Use Provider for IdentifiedUser in CreateBranch constructor

This is the same fix that was already done for DeleteBranch's
constructor in If7fd7f4c38bcbc685d4f9451479da7a9ed432564.

Change-Id: Ied38df303eaf4ea1893527e947633445974e9d19
Only permit current patch set to edit the commit message

Do not allow users to replace a more recent patch set with an older
patch set when there is a race between the web UI and the command
line git client:

 1. Upload a new change (Patch Set 1)
 2. Open the code review page in a browser
 3. Upload a second version of the change (Patch Set 2)

 4. Without refreshing the code review page, so that it's still
    showing Patch Set 1, click the Edit Message button, change the
    commit message, and hit save.

 5. Note that this has created a Patch Set 3 with file contents taken
    from Patch Set 1 but the edited message.

Change-Id: I73af89989b72d9e702061b3746390df68cef4b62
Merge changes Ied38df30,I98f4b7c7,Icd99b92c,If7fd7f4c into stable-2.8

* changes:
  Use Provider for IdentifiedUser in CreateBranch constructor
  Split PGPEncryptedDataGenerator creation out into a utility method
  ChangeScreen2: Only reset the commit message text on cancel
  Fix log spew caused by DeleteBranch constructor
Merge "Added global request handlers to SshDaemon" into stable-2.8