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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user