diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-31 14:05:06 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-31 17:48:32 +0200 |
commit | 9f16852c3d219379989f7480f90d66ffa5fb6509 (patch) | |
tree | b942adff4b6582c22fabd70d39175a154e7b6057 /sonar-ws-client/src/main/java/org | |
parent | 70cd924529a3567f6042e1d8fcbd9a64c0693d1a (diff) | |
download | sonarqube-9f16852c3d219379989f7480f90d66ffa5fb6509.tar.gz sonarqube-9f16852c3d219379989f7480f90d66ffa5fb6509.zip |
SONAR-2488 Add the id for violations in the WS Client
Diffstat (limited to 'sonar-ws-client/src/main/java/org')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java | 19 | ||||
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java | 1 |
2 files changed, 18 insertions, 2 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java index 704bc76efa8..f88a3157ff1 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Violation.java @@ -23,6 +23,7 @@ import java.util.Date; public class Violation extends Model { + private Long id = null; private String message = null; private String severity = null; private Integer line = null; @@ -85,8 +86,8 @@ public class Violation extends Model { public void setLine(Integer line) { if (line != null && line < 1) { /* - * This shouldn't happen, however line would be normalized to null if web service returns incorrect value (less than 1) - * in compliance with a contract for getLine method. Normalization added in 2.8 - see http://jira.codehaus.org/browse/SONAR-2386 + * This shouldn't happen, however line would be normalized to null if web service returns incorrect value (less than 1) in compliance + * with a contract for getLine method. Normalization added in 2.8 - see http://jira.codehaus.org/browse/SONAR-2386 */ this.line = null; } else { @@ -206,4 +207,18 @@ public class Violation extends Model { this.review = review; return this; } + + /** + * @since 2.9 + */ + public Long getId() { + return id; + } + + /** + * @since 2.9 + */ + public void setId(Long id) { + this.id = id; + } } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java index c8b5558eb22..f721c7135c1 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ViolationUnmarshaller.java @@ -29,6 +29,7 @@ public class ViolationUnmarshaller extends AbstractUnmarshaller<Violation> { WSUtils utils = WSUtils.getINSTANCE(); Violation violation = new Violation(); + violation.setId(utils.getLong(json, "id")); violation.setMessage(utils.getString(json, "message")); violation.setLine(utils.getInteger(json, "line")); violation.setSeverity(utils.getString(json, "priority")); |