From 7680c6048bfb144dcbe85a5f211bd9632bad9454 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 23 May 2012 16:25:55 +0200 Subject: [PATCH] Fix violations --- .../main/java/org/sonar/batch/RemoteServerMetadata.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/RemoteServerMetadata.java b/sonar-batch/src/main/java/org/sonar/batch/RemoteServerMetadata.java index c4202a5e40b..3a830404076 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/RemoteServerMetadata.java +++ b/sonar-batch/src/main/java/org/sonar/batch/RemoteServerMetadata.java @@ -46,19 +46,16 @@ public class RemoteServerMetadata implements BatchComponent { public String getServerId() throws IOException { String remoteServerInfo = remoteContent("/api/server"); // don't use JSON utilities to extract ID from such a small string - String id = extractId(remoteServerInfo); - return id; + return extractId(remoteServerInfo); } protected String extractId(String remoteServerInfo) { String partialId = StringUtils.substringAfter(remoteServerInfo, "\"id\":\""); - String id = StringUtils.substringBefore(partialId, "\""); - return id; + return StringUtils.substringBefore(partialId, "\""); } protected String getUrlFor(String path) { - String fullUrl = serverUrl + path; - return fullUrl; + return serverUrl + path; } protected String remoteContent(String path) throws IOException { -- 2.39.5