From: Evgeny Mandrikov Date: Wed, 27 Apr 2011 21:15:01 +0000 (+0400) Subject: SONAR-2386 Web service should return lineId for violation only if value exists X-Git-Tag: 2.8~103 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a39ab144806eebbcff01e90c734b1157f6256bef;p=sonarqube.git SONAR-2386 Web service should return lineId for violation only if value exists --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb index 0d66db2da28..c39747fadaf 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb @@ -44,7 +44,7 @@ class RuleFailure < ActiveRecord::Base def to_hash_json json = {} json['message'] = message - json['line'] = line if line + json['line'] = line if line && line>=1 json['priority'] = Sonar::RulePriority.to_s(failure_level).upcase json['falsePositive']=true if false_positive? if created_at @@ -68,7 +68,7 @@ class RuleFailure < ActiveRecord::Base def to_xml(xml=Builder::XmlMarkup.new(:indent => 0)) xml.violation do xml.message(message) - xml.line(line) if line + xml.line(line) if line && line>=1 xml.priority(Sonar::RulePriority.to_s(failure_level)) xml.falsePositive(true) if false_positive? if created_at