]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2706 Rule name can be empty in DB
authorFabrice Bellingard <bellingard@gmail.com>
Fri, 25 May 2012 15:49:39 +0000 (17:49 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Fri, 25 May 2012 15:50:33 +0000 (17:50 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb

index 4cde503c03ddd2b5fb94eb90f96624b988446906..a9d96e1bae50ffda7fa30532c3d7cf8975ce21cb 100644 (file)
@@ -78,7 +78,13 @@ class Rule < ActiveRecord::Base
           result
         end
     else
-      read_attribute(:name)
+      @raw_name ||=
+        begin
+          result = read_attribute(:name)
+          # if no name present in the DB, then name is in the English bundle for sure
+          result = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleName("en", repository_key, plugin_rule_key) unless result
+          result
+        end
     end
   end