Skip to content

Commit e679dc7

Browse files
committed
reduce returns to single place
1 parent e13faa8 commit e679dc7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/src/main/java/opengrok/auth/plugin/util/RestfulClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ private RestfulClient() {
5050
* @return HTTP status or -1
5151
*/
5252
public static int postIt(String uri, String input) {
53+
int result;
5354
try {
5455
try (Client client = ClientBuilder.newClient()) {
5556
LOGGER.log(Level.FINEST, "sending REST POST request to {0}: {1}",
@@ -63,12 +64,13 @@ public static int postIt(String uri, String input) {
6364
LOGGER.log(Level.WARNING, "REST request failed: HTTP error code : {0}", status);
6465
}
6566

66-
return status;
67+
result = status;
6768
}
6869
}
6970
} catch (Exception e) {
7071
LOGGER.log(Level.WARNING, "REST request failed", e);
71-
return -1;
72+
result = -1;
7273
}
74+
return result;
7375
}
7476
}

0 commit comments

Comments
 (0)