this.ruleActivator = ruleActivator;
this.definitions = definitions;
}
public void start() {
TimeProfiler profiler = new TimeProfiler(LOGGER).start("Register Quality Profiles");
DbSession session = dbClient.openSession(false);
try {
ListMultimap<String, RulesProfile> profilesByLanguage = profilesByLanguage();
for (String language : profilesByLanguage.keySet()) {
List<RulesProfile> defs = profilesByLanguage.get(language);
verifyLanguage(language, defs);
for (Map.Entry<String, Collection<RulesProfile>> entry : profilesByName(defs).entrySet()) {
String name = entry.getKey();
QProfileName profileName = new QProfileName(language, name);
if (shouldRegister(profileName, session)) {
register(profileName, entry.getValue(), session);
session.commit();
}
builtInProfiles.put(language, name);
}
setDefault(language, defs, session);
session.commit();
}
} finally {
session.close();
profiler.stop();
}
}