Github user vrozov commented on a diff in the pull request:
https://github.com/apache/incubator-apex-core/pull/171#discussion_r45074939
--- Diff:
common/src/main/java/com/datatorrent/common/util/PubSubWebSocketClient.java ---
@@ -201,40 +208,43 @@ public void openConnectionAsync() throws IOException
try {
json.put("userName", userName);
json.put("password", password);
- }
- catch (JSONException ex) {
+ } catch (JSONException ex) {
throw new RuntimeException(ex);
}
- client.preparePost(loginUrl).setHeader("Content-Type",
"application/json").setBody(json.toString()).execute(new
AsyncCompletionHandler<Response>()
- {
-
- @Override
- public Response onCompleted(Response response) throws Exception
- {
- List<Cookie> cookies = response.getCookies();
- BoundRequestBuilder brb = client.prepareGet(uri.toString());
- if (cookies != null) {
- for (Cookie cookie : cookies) {
- brb.addCookie(cookie);
+ client.preparePost(loginUrl).setHeader("Content-Type",
"application/json").setBody(json.toString())
--- End diff --
Consider introducing local variable
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---