aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-07-29 10:13:51 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-07-29 10:13:51 +0200
commit30b1e36d9b882350e1c3e35cde4d20a0b69e9c7f (patch)
treeda0ff19bfabfb12ea273cde8c7da73fd1ed3ff6c /server/sonar-server
parent9823de5d25275b7cf8df914243f0f71fd13c0b71 (diff)
downloadsonarqube-30b1e36d9b882350e1c3e35cde4d20a0b69e9c7f.tar.gz
sonarqube-30b1e36d9b882350e1c3e35cde4d20a0b69e9c7f.zip
SONAR-7926 remove redundant condition
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java17
1 files changed, 4 insertions, 13 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java b/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java
index 12186285a0d..bdc7906209d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/projectlink/ws/CreateAction.java
@@ -116,21 +116,12 @@ public class CreateAction implements ProjectLinksWsAction {
}
private static CreateWsResponse buildResponse(ComponentLinkDto link) {
- CreateWsResponse.Builder response = CreateWsResponse.newBuilder();
-
- WsProjectLinks.Link.Builder linkBuilder = WsProjectLinks.Link.newBuilder()
+ return CreateWsResponse.newBuilder().setLink(WsProjectLinks.Link.newBuilder()
.setId(String.valueOf(link.getId()))
.setName(link.getName())
- .setUrl(link.getHref());
-
- String type = link.getType();
- if (type != null) {
- linkBuilder.setType(type);
- }
-
- response.setLink(linkBuilder);
-
- return response.build();
+ .setType(link.getType())
+ .setUrl(link.getHref()))
+ .build();
}
private ComponentDto getComponentByUuidOrKey(DbSession dbSession, CreateWsRequest request) {