From: Fabrice Bellingard Date: Wed, 23 May 2012 14:25:55 +0000 (+0200) Subject: Fix violations X-Git-Tag: 3.1~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7680c6048bfb144dcbe85a5f211bd9632bad9454;p=sonarqube.git Fix violations --- 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 {