From: Simon Brandhof Date: Mon, 15 Aug 2011 14:35:03 +0000 (+0200) Subject: SONAR-2646 When there isn't any violation in a project the hotspot widget 'Most viola... X-Git-Tag: 2.11^2~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fb059059ba3dd0dabc76a9ee3f63a3365769ed64;p=sonarqube.git SONAR-2646 When there isn't any violation in a project the hotspot widget 'Most violated rules' never finished to be displayed --- diff --git a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java index 44d08372033..4c707e6f327 100644 --- a/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java +++ b/plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/hotspots/client/widget/MostViolatedRules.java @@ -91,7 +91,7 @@ public class MostViolatedRules extends AbstractHotspot { @Override protected void doOnResponse(Resource resource) { - if (resource.getMeasures().isEmpty()) { + if (resource==null || resource.getMeasures().isEmpty()) { renderEmptyResults(); } else { renderGrid(resource); @@ -133,9 +133,9 @@ public class MostViolatedRules extends AbstractHotspot { .setDepth(0) .setExcludeRules(false) .setLimit(LIMIT); - String priority = getSelectedPriority(); - if (priority!=null) { - query.setRulePriorities(priority); + String severity = getSelectedPriority(); + if (severity!=null) { + query.setRuleSeverities(severity); } return query; }