From b150482f1f4ea43bc42b324994d1d1e852de6320 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Fri, 27 Apr 2012 17:05:35 +0200 Subject: Code cleaning : Add @Override annotations --- sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java | 2 ++ .../main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java | 4 ++++ .../main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java | 4 ++++ .../org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java | 1 + sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java | 2 ++ 5 files changed, 13 insertions(+) (limited to 'sonar-ws-client') diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java index 2d5e5cef509..3643750f43c 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/JdkUtils.java @@ -33,11 +33,13 @@ import java.util.Set; public final class JdkUtils extends WSUtils { + @Override public String format(Date date, String format) { SimpleDateFormat dateFormat = new SimpleDateFormat(format); return dateFormat.format(date); } + @Override public String encodeUrl(String url) { try { return URLEncoder.encode(url, "UTF-8"); diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java index aa1d4677a43..dfd615778cb 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient3Connector.java @@ -69,18 +69,22 @@ public class HttpClient3Connector extends Connector { } } + @Override public String execute(Query query) { return executeRequest(newGetRequest(query)); } + @Override public String execute(CreateQuery query) { return executeRequest(newPostRequest(query)); } + @Override public String execute(UpdateQuery query) { return executeRequest(newPutRequest(query)); } + @Override public String execute(DeleteQuery query) { return executeRequest(newDeleteRequest(query)); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java index 5c7521091d9..40d216d8944 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/connectors/HttpClient4Connector.java @@ -70,18 +70,22 @@ public class HttpClient4Connector extends Connector { this.server = server; } + @Override public String execute(Query query) { return executeRequest(newGetMethod(query)); } + @Override public String execute(CreateQuery query) { return executeRequest(newPostMethod(query)); } + @Override public String execute(UpdateQuery query) { return executeRequest(newPutMethod(query)); } + @Override public String execute(DeleteQuery query) { return executeRequest(newDeleteMethod(query)); } diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java index c550ec0afb5..473e9f4bfb2 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java @@ -26,6 +26,7 @@ import org.sonar.wsclient.services.WSUtils; public class TimeMachineUnmarshaller extends AbstractUnmarshaller { + @Override protected TimeMachine parse(Object json) { WSUtils utils = WSUtils.getINSTANCE(); Object cols = utils.getField(json, "cols"); diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java index 23b1a205ec8..49ce5918fef 100644 --- a/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java +++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/SonarTest.java @@ -123,10 +123,12 @@ public class SonarTest { } static class EmptyQuery extends Query { + @Override public String getUrl() { return "/api/empty"; } + @Override public Class getModelClass() { return Metric.class; } -- cgit v1.2.3