]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4353 drop the node 'id' from result
authorSimon Brandhof <simon.brandhof@gmail.com>
Sat, 25 May 2013 13:02:18 +0000 (15:02 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Sat, 25 May 2013 13:02:18 +0000 (15:02 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/api/violations_controller.rb
sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java
sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java
sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshallerTest.java
sonar-ws-client/src/test/resources/violations/violations.json

index aeadcfd963e75e5305629d93034c3c60bfa47b13..a0e35c8fe9c8ae7a494a664ffef607100c51b710 100644 (file)
@@ -62,7 +62,7 @@ class Api::ViolationsController < Api::ApiController
     results = Api.issues.find(conditions)
 
     array = results.issues.map do |issue|
-      hash={:id => issue.key}
+      hash={}
       hash[:message] = issue.message if issue.message
       hash[:line] = issue.line.to_i if issue.line
       hash[:priority] = issue.severity if issue.severity
index 485db0910a1f56f0c636368a793544ffcc173ccf..fbd41ac18b7db43c2ca923c1e30c55cc4a8c934b 100644 (file)
@@ -27,7 +27,6 @@ import java.util.Date;
 @Deprecated
 public class Violation extends Model {
 
-  private String id = null;
   private String message = null;
   private String severity = null;
   private Integer line = null;
@@ -186,12 +185,4 @@ public class Violation extends Model {
     return switchedOff;
   }
 
-  public String getKey() {
-    return id;
-  }
-
-  public Violation setKey(String id) {
-    this.id = id;
-    return this;
-  }
 }
index 25e5b5b585c978d18b8924cd3b6e9d2d42f68f78..ea25de8c3d114b234b255fb2a4351093259af1fe 100644 (file)
@@ -29,7 +29,6 @@ public class ViolationUnmarshaller extends AbstractUnmarshaller<Violation> {
     WSUtils utils = WSUtils.getINSTANCE();
 
     Violation violation = new Violation();
-    violation.setKey(utils.getString(json, "id"));
     violation.setMessage(utils.getString(json, "message"));
     violation.setLine(utils.getInteger(json, "line"));
     violation.setSeverity(utils.getString(json, "priority"));
index 1eccd7e3158eb7d787f4ce93d0e17e5842962a98..75485ae54443aa2a3212dc6de84ae02298fa5ced 100644 (file)
@@ -47,7 +47,6 @@ public class ViolationUnmarshallerTest extends UnmarshallerTestCase {
     assertThat(violations.size(), is(2));
 
     violation = violations.get(0);
-    assertThat(violation.getKey(), is("1"));
     assertThat(violation.getMessage(), is("throw java.lang.Exception"));
     assertThat(violation.hasLine(), is(true));
     assertThat(violation.getLine(), is(97));
index 66353635fabce6762b97f6f3aaf6599f7b3f0a76..06c97eef38cdbb4b755ece7d59ea771ece8f8ff1 100644 (file)
@@ -1,4 +1,4 @@
 [
-  {"id":1,"message":"throw java.lang.Exception","line":97,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:SignatureDeclareThrowsException","name":"Signature Declare Throws Exception","category":"Maintainability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","scope":"FIL","qualifier":"CLA","language":"java"}},
-  {"id":2,"message":"The user-supplied array 'threads' is stored directly.","line":242,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:ArrayIsStoredDirectly","name":"Security - Array is stored directly","category":"Reliability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","scope":"FIL","qualifier":"CLA","language":"java"}}
+  {"message":"throw java.lang.Exception","line":97,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:SignatureDeclareThrowsException","name":"Signature Declare Throws Exception","category":"Maintainability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","qualifier":"CLA"}},
+  {"message":"The user-supplied array 'threads' is stored directly.","line":242,"createdAt":"2010-12-01T13:55:22+0300","priority":"MAJOR","rule":{"key":"pmd:ArrayIsStoredDirectly","name":"Security - Array is stored directly","category":"Reliability"},"resource":{"key":"org.apache.excalibur.components:excalibur-pool-instrumented:org.apache.avalon.excalibur.pool.TraceableResourceLimitingPool","name":"TraceableResourceLimitingPool","qualifier":"CLA"}}
 ]
\ No newline at end of file