From a39ab144806eebbcff01e90c734b1157f6256bef Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 28 Apr 2011 01:15:01 +0400 Subject: [PATCH] SONAR-2386 Web service should return lineId for violation only if value exists --- .../src/main/webapp/WEB-INF/app/models/rule_failure.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5