Merge branch 'stable-2.8'

* stable-2.8:
  Update release notes with recently made changes
  Buck: extend the tool chain to support unsigning JARs
  Update jgit to 3.1.0.201310021548-r
  Fixing jdbc code: correct Statement closing
  Remove unnecessary imports
  Print error message to log when plugin loader fails to close JAR file
  Document how plugins can listen to stream-events

Change-Id: I2f0051fdf065a6b0170294c6f9dfbef1ea4018ab
This commit is contained in:
David Pursehouse
2013-11-05 10:52:15 +09:00
8 changed files with 24 additions and 19 deletions

View File

@@ -52,6 +52,7 @@ The currently supported message types are *patchset-created*,
Note that any field may be missing in the JSON messages, so consumers of
this JSON stream should deal with that appropriately.
[[events]]
Events
~~~~~~
Patchset Created

View File

@@ -346,6 +346,12 @@ Certain operations in Gerrit trigger events. Plugins may receive
notifications of these events by implementing the corresponding
listeners.
* `com.google.gerrit.common.ChangeListener`:
+
Allows to listen to change events. These are the same
link:cmd-stream-events.html#events[events] that are also streamed by
the link:cmd-stream-events.html[gerrit stream-events] command.
* `com.google.gerrit.extensions.events.LifecycleListener`:
+
Gerrit server startup and shutdown

View File

@@ -735,7 +735,7 @@ release notes.
Upgrades
--------
* Update JGit to 3.0.0.201306101825-r.41-g84d2738
* Update JGit to 3.1.0.201310021548-r
* Update gwtorm to 1.7
* Update guice to 4.0-beta
* Update guava to 15.0

View File

@@ -14,8 +14,6 @@
package org.eclipse.jgit.internal.storage.file;
import org.eclipse.jgit.internal.storage.file.WindowCache;
// Hack to obtain visibility to package level methods only.
// These aren't yet part of the public JGit API.

View File

@@ -31,7 +31,6 @@ import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.treewalk.TreeWalk;
import java.io.IOException;
import java.nio.charset.CharacterCodingException;
/** State supporting processing of a single {@link Patch} instance. */
public class PatchFile {
@@ -89,7 +88,6 @@ public class PatchFile {
* @throws CorruptEntityException the patch cannot be read.
* @throws IOException the patch or complete file content cannot be read.
* @throws NoSuchEntityException
* @throws CharacterCodingException the file is not a known character set.
*/
public String getLine(final int file, final int line)
throws CorruptEntityException, IOException, NoSuchEntityException {

View File

@@ -32,6 +32,7 @@ class CleanupHandle {
try {
jarFile.close();
} catch (IOException err) {
PluginLoader.log.error("Cannot close " + jarFile.getName(), err);
}
if (!tmpFile.delete() && tmpFile.exists()) {
PluginLoader.log.warn("Cannot delete " + tmpFile.getAbsolutePath()

View File

@@ -14,8 +14,6 @@
package com.google.gerrit.server.ioutil;
import com.google.gerrit.server.ioutil.ColumnFormatter;
import junit.framework.TestCase;
import java.io.PrintWriter;

View File

@@ -23,13 +23,14 @@ import java.io.File;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public final class SiteInitializer {
private static final Logger log = LoggerFactory
private static final Logger LOG = LoggerFactory
.getLogger(SiteInitializer.class);
final String sitePath;
final String initPath;
private final String sitePath;
private final String initPath;
SiteInitializer(String sitePath, String initPath) {
this.sitePath = sitePath;
@@ -38,10 +39,9 @@ public final class SiteInitializer {
public void init() {
try {
if (sitePath != null) {
File site = new File(sitePath);
log.info(String.format("Initializing site at %s",
LOG.info(String.format("Initializing site at %s",
site.getAbsolutePath()));
new BaseInit(site, false).run();
return;
@@ -53,9 +53,8 @@ public final class SiteInitializer {
if (site == null && initPath != null) {
site = new File(initPath);
}
if (site != null) {
log.info(String.format("Initializing site at %s",
LOG.info(String.format("Initializing site at %s",
site.getAbsolutePath()));
new BaseInit(site, new ReviewDbDataSourceProvider(), false).run();
}
@@ -63,7 +62,7 @@ public final class SiteInitializer {
conn.close();
}
} catch (Exception e) {
log.error("Site init failed", e);
LOG.error("Site init failed", e);
throw new RuntimeException(e);
}
}
@@ -74,10 +73,14 @@ public final class SiteInitializer {
private File getSiteFromReviewDb(Connection conn) {
try {
ResultSet rs = conn.createStatement().executeQuery(
"select site_path from system_config");
if (rs.next()) {
return new File(rs.getString(1));
Statement stmt = conn.createStatement();
try {
ResultSet rs = stmt.executeQuery("SELECT site_path FROM system_config");
if (rs.next()) {
return new File(rs.getString(1));
}
} finally {
stmt.close();
}
return null;
} catch (SQLException e) {