diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-30 19:18:32 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-30 19:19:12 +0200 |
commit | a7ef4f0a1d3c51ab9f74a8ac4bd695fe84c947eb (patch) | |
tree | abaeed322b7a16d2d9dff671ea429f9fa64a4064 /sonar-ws-client/src/main/java/org/sonar/wsclient | |
parent | 3cd3a7dcc73cb3924d8c61f532423226bb38b38b (diff) | |
download | sonarqube-a7ef4f0a1d3c51ab9f74a8ac4bd695fe84c947eb.tar.gz sonarqube-a7ef4f0a1d3c51ab9f74a8ac4bd695fe84c947eb.zip |
SONAR-2453 Update the way "FALSE-POSITIVE" reviews are managed
Add the violation id on a review JSON/XML format so that we don't
have to add it later when we implement manual reviews.
Diffstat (limited to 'sonar-ws-client/src/main/java/org/sonar/wsclient')
6 files changed, 26 insertions, 8 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Review.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Review.java index ba17f28d376..596b2763639 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Review.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Review.java @@ -40,6 +40,7 @@ public class Review extends Model { private String resourceKee = null; private Integer line = null; private Boolean falsePositive = null; + private Long violationId; private List<Review.Comment> comments = new ArrayList<Review.Comment>(); /** @@ -243,6 +244,23 @@ public class Review extends Model { this.falsePositive = falsePositive; return this; } + + /** + * @since 2.9 + * @return the violation id + */ + public Long getViolationId() { + return violationId; + } + + /** + * @param id + * the violation id to set + */ + public Review setViolationId(Long violationId) { + this.violationId = violationId; + return this; + } /** * @return the comments diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewCreateQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewCreateQuery.java index 96d7a57c66a..f48eb971e19 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewCreateQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewCreateQuery.java @@ -22,7 +22,7 @@ package org.sonar.wsclient.services; /** * @since 2.9 */ -public class ReviewCreateQuery extends UpdateQuery<Review> { +public class ReviewCreateQuery extends CreateQuery<Review> { private Long violationId; private String text; diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewDeleteQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewDeleteQuery.java index fc919b00ea5..5a217666607 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewDeleteQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewDeleteQuery.java @@ -22,7 +22,7 @@ package org.sonar.wsclient.services; /** * @since 2.9 */ -public class ReviewDeleteQuery extends CreateQuery<Review> { +public class ReviewDeleteQuery extends DeleteQuery<Review> { private Long reviewId; private Long commentId; @@ -74,9 +74,4 @@ public class ReviewDeleteQuery extends CreateQuery<Review> { appendUrlParameter(url, "comment_id", getCommentId()); return url.toString(); } - - @Override - public Class<Review> getModelClass() { - return Review.class; - } } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java index a6701d4a18e..800bc048e04 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewQuery.java @@ -264,6 +264,10 @@ public class ReviewQuery extends Query<Review> { return Review.class; } + public static ReviewQuery createForReview(Long id) { + return new ReviewQuery().setId(id); + } + public static ReviewQuery createForResource(Resource resource) { return new ReviewQuery().setResourceKeysOrIds(resource.getId().toString()); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewUpdateQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewUpdateQuery.java index 328ec295216..244ef0b5b4d 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewUpdateQuery.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ReviewUpdateQuery.java @@ -22,7 +22,7 @@ package org.sonar.wsclient.services; /** * @since 2.9 */ -public class ReviewUpdateQuery extends CreateQuery<Review> { +public class ReviewUpdateQuery extends UpdateQuery<Review> { private Long reviewId; private String text; diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ReviewUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ReviewUnmarshaller.java index f3fbb3a57e4..3ea023700ea 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ReviewUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ReviewUnmarshaller.java @@ -43,6 +43,7 @@ public class ReviewUnmarshaller extends AbstractUnmarshaller<Review> { review.setResourceKee(utils.getString(json, "resource")); review.setLine(utils.getInteger(json, "line")); review.setFalsePositive(utils.getBoolean(json, "falsePositive")); + review.setViolationId(utils.getLong(json, "violationId")); review.setType(utils.getString(json, "type")); Object comments = utils.getField(json, "comments"); |