]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2706 Search for rule name in the English bundle before DB
authorFabrice Bellingard <bellingard@gmail.com>
Fri, 25 May 2012 16:06:26 +0000 (18:06 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Fri, 25 May 2012 16:08:43 +0000 (18:08 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/rule.rb

index a9d96e1bae50ffda7fa30532c3d7cf8975ce21cb..ec7e9c2b622916f5ca1d4cf7456faa1cc7ea7a15 100644 (file)
@@ -80,9 +80,9 @@ class Rule < ActiveRecord::Base
     else
       @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 = Java::OrgSonarServerUi::JRubyFacade.getInstance().getRuleName("en", repository_key, plugin_rule_key)
+          # if no name present in the bundle, try to find it in the DB
+          result = read_attribute(:name) unless result
           result
         end
     end