private static Dialect findById(final String dialectId) {
return findDialect(new Predicate<Dialect>() {
- public boolean apply(Dialect dialect) {
- return dialect.getId().equals(dialectId);
+ public boolean apply(@Nullable Dialect dialect) {
+ return dialect != null && dialect.getId().equals(dialectId);
}
});
}
try {
cleanDirectory();
this.outputDir = new File(settings.getString(ServerSettings.DEPLOY_DIR), "gwt");
- Logs.INFO.debug("publish {} GWT extensions to {}", extensions.length, outputDir);
+ LoggerFactory.getLogger(GwtPublisher.class).debug("Deploy {} GWT extensions to {}", extensions.length, outputDir);
publish();
} catch (Exception e) {
- throw new SonarException("can not publish GWT extensions", e);
+ throw new IllegalStateException("Fail to deploy GWT extensions", e);
}
profiler.stop();
}
if (sourceDir == null) {
throw new SonarException("Can not find the directory " + module.getGwtId() + " defined by the GWT module " + module.getClass().getName());
}
- Logs.INFO.info("publish {} to {}", module.getGwtId(), outputDir);
+ Logs.INFO.info("Deploy {} to {}", module.getGwtId(), outputDir);
if (sourceDir.toString().startsWith("jar:file")) {
// unzip the JAR
String path = StringUtils.substringBetween(sourceDir.toString(), "jar:file:", "!");
public class JdbcDriverDeployer {
- private DefaultServerFileSystem fileSystem;
+ private final DefaultServerFileSystem fileSystem;
public JdbcDriverDeployer(DefaultServerFileSystem fileSystem) {
this.fileSystem = fileSystem;
public class RegisterMetrics {
- private MeasuresDao measuresDao;
- private Metrics[] metricsRepositories = null;
- private DatabaseSession session;
+ private final MeasuresDao measuresDao;
+ private final Metrics[] metricsRepositories;
+ private final DatabaseSession session;
public RegisterMetrics(DatabaseSession session, MeasuresDao measuresDao, Metrics[] metricsRepositories) {
this.session = session;
public final class RegisterQualityModels {
- private ModelManager manager;
+ private final ModelManager manager;
/**
* @param registerRulesBeforeModels used only to be started after the creation of check templates
public final class RegisterRules {
- private DatabaseSessionFactory sessionFactory;
- private List<RuleRepository> repositories = Lists.newArrayList();
- private RuleI18nManager ruleI18nManager;
+ private final DatabaseSessionFactory sessionFactory;
+ private final List<RuleRepository> repositories;
+ private final RuleI18nManager ruleI18nManager;
public RegisterRules(DatabaseSessionFactory sessionFactory, RuleRepository[] repos, RuleI18nManager ruleI18nManager) {
this.sessionFactory = sessionFactory;
- this.repositories.addAll(Arrays.asList(repos));
+ this.repositories = Arrays.asList(repos);
this.ruleI18nManager = ruleI18nManager;
}
public class ServerMetadataPersister {
- private Server server;
- private DatabaseSession session;
+ private final Server server;
+ private final DatabaseSession session;
public ServerMetadataPersister(Server server, DatabaseSession session) {
this.server = server;
--- /dev/null
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2012 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+@ParametersAreNonnullByDefault
+package org.sonar.server.startup;
+
+import javax.annotation.ParametersAreNonnullByDefault;
\ No newline at end of file