import org.apache.commons.lang.builder.ToStringBuilder;
import org.hibernate.annotations.BatchSize;
import org.sonar.api.database.BaseIdentifiable;
+import org.sonar.api.resources.Language;
import org.sonar.api.resources.ProjectLink;
import org.sonar.api.resources.Resource;
model.setDescription(resource.getDescription());
model.setKey(resource.getEffectiveKey());
model.setPath(resource.getPath());
- if (resource.getLanguage() != null) {
- model.setLanguageKey(resource.getLanguage().getKey());
+ Language lang = resource.getLanguage();
+ if (lang != null) {
+ model.setLanguageKey(lang.getKey());
}
if (StringUtils.isNotBlank(resource.getName())) {
model.setName(resource.getName());
}
private void addIndexTemplates() {
- PutIndexTemplateResponse response = node.client().admin().indices()
+ node.client().admin().indices()
.preparePutTemplate("default")
.setTemplate("*")
.addMapping("_default_", "{\"dynamic\": \"strict\"}")