]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2386 Web service should return lineId for violation only if value exists
authorEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 27 Apr 2011 21:15:01 +0000 (01:15 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 27 Apr 2011 21:15:37 +0000 (01:15 +0400)
sonar-server/src/main/webapp/WEB-INF/app/models/rule_failure.rb

index 0d66db2da288d7e3da8019c4ea65aa8118a775eb..c39747fadaf004fafac92fa5a60785d6962471bd 100644 (file)
@@ -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