"Report Bug" URL can never be null

The config provider will always provide a value.  Either the
value given by the user in gerrit.config, or the default value.

Change-Id: I9b7107857c79f939ed5315e52610277b05ef7d67
This commit is contained in:
David Pursehouse
2013-12-10 17:06:21 +09:00
parent 0c4bde4669
commit 6a5850e3d0
2 changed files with 11 additions and 15 deletions

View File

@@ -463,15 +463,14 @@ public class Gerrit implements EntryPoint {
btmmenu.add(new InlineLabel(C.keyHelp()));
btmmenu.add(new InlineLabel(" | "));
btmmenu.add(new InlineHTML(M.poweredBy(vs)));
if (getConfig().getReportBugUrl() != null) {
Anchor a = new Anchor(
C.reportBug(),
getConfig().getReportBugUrl());
a.setTarget("_blank");
a.setStyleName("");
btmmenu.add(new InlineLabel(" | "));
btmmenu.add(a);
}
Anchor a = new Anchor(
C.reportBug(),
getConfig().getReportBugUrl());
a.setTarget("_blank");
a.setStyleName("");
btmmenu.add(new InlineLabel(" | "));
btmmenu.add(a);
}
private void onModuleLoad2(HostPageData hpd) {

View File

@@ -129,12 +129,9 @@ class GerritConfigProvider implements Provider<GerritConfig> {
config.setLargeChangeSize(cfg.getInt("change", "largeChange", 500));
config.setNewFeatures(cfg.getBoolean("gerrit", "enableNewFeatures", true));
config.setReportBugUrl(cfg.getString("gerrit", null, "reportBugUrl"));
if (config.getReportBugUrl() == null) {
config.setReportBugUrl("http://code.google.com/p/gerrit/issues/list");
} else if (config.getReportBugUrl().isEmpty()) {
config.setReportBugUrl(null);
}
final String reportBugUrl = cfg.getString("gerrit", null, "reportBugUrl");
config.setReportBugUrl(reportBugUrl != null ?
reportBugUrl : "http://code.google.com/p/gerrit/issues/list");
config.setGitBasicAuth(authConfig.isGitBasicAuth());