aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-30 16:04:54 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-30 16:04:54 +0200
commitef9b3e8704be8de9f30c42f9e8034588309f6e16 (patch)
treec7dd0b61fb62e7da932adfe9ccc1573855bf3842 /sonar-plugin-api/src/main
parent12fac031dc2702e565f33254593d32bfce29faa1 (diff)
downloadsonarqube-ef9b3e8704be8de9f30c42f9e8034588309f6e16.tar.gz
sonarqube-ef9b3e8704be8de9f30c42f9e8034588309f6e16.zip
Fix some quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
index e40bd0254d8..05a03c5a48b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
@@ -25,6 +25,7 @@ import org.apache.commons.lang.builder.HashCodeBuilder;
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;
@@ -384,8 +385,9 @@ public class ResourceModel extends BaseIdentifiable implements Cloneable {
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());